From 837bd9c58c990efe4d4e47f657823627e1a6fc7a Mon Sep 17 00:00:00 2001 From: Neptune MM Date: Thu, 22 Oct 2026 18:13:32 +0200 Subject: [PATCH] topology displays --- CHANGELOG_top_displays.md | 28 + analysis_stdlib/Rstruct_topology.v | 8 +- analysis_stdlib/showcase/uniform_bigO.v | 2 +- classical/filter.v | 230 ++++++--- theories/borel_hierarchy.v | 2 +- theories/cantor.v | 43 +- theories/derive.v | 294 ++++++----- theories/ereal.v | 10 +- theories/esum.v | 2 +- theories/exp.v | 6 +- theories/ftc.v | 12 +- .../functional_analysis/hahn_banach_theorem.v | 14 +- theories/gauss_integral.v | 6 +- theories/homotopy_theory/continuous_path.v | 71 +-- theories/homotopy_theory/wedge_sigT.v | 31 +- theories/landau.v | 104 ++-- .../lebesgue_integral_differentiation.v | 3 +- .../measurable_fun_approximation.v | 10 +- .../lebesgue_integral_theory/radon_nikodym.v | 2 +- theories/measure_theory/signed_measure.v | 2 +- .../complete_normed_module.v | 6 +- theories/normedtype_theory/ereal_normedtype.v | 9 +- .../normedtype_theory/matrix_normedtype.v | 30 +- theories/normedtype_theory/normed_module.v | 257 +++++----- theories/normedtype_theory/num_normedtype.v | 12 +- .../pseudometric_normed_Zmodule.v | 389 +++++++------- theories/normedtype_theory/tvs.v | 227 +++++---- theories/normedtype_theory/urysohn.v | 146 +++--- theories/normedtype_theory/vitali_lemma.v | 2 +- theories/numfun.v | 23 +- .../probability_theory/beta_distribution.v | 6 +- .../exponential_distribution.v | 10 +- theories/probability_theory/random_variable.v | 4 +- .../real_measure/lebesgue_stieltjes_measure.v | 38 +- theories/realfun.v | 25 +- theories/sequences.v | 79 +-- theories/showcase/summability.v | 4 +- theories/topology_theory/bool_topology.v | 11 +- theories/topology_theory/compact.v | 60 ++- theories/topology_theory/connected.v | 43 +- theories/topology_theory/discrete_topology.v | 95 ++-- theories/topology_theory/edist.v | 17 +- theories/topology_theory/function_spaces.v | 478 +++++++++++------- theories/topology_theory/initial_topology.v | 74 +-- theories/topology_theory/matrix_topology.v | 33 +- theories/topology_theory/metric_structure.v | 82 +-- theories/topology_theory/nat_topology.v | 11 +- theories/topology_theory/num_topology.v | 38 +- .../one_point_compactification.v | 18 +- theories/topology_theory/order_topology.v | 80 +-- theories/topology_theory/product_topology.v | 46 +- .../topology_theory/pseudometric_structure.v | 127 +++-- theories/topology_theory/quotient_topology.v | 15 +- theories/topology_theory/separation_axioms.v | 129 +++-- theories/topology_theory/sigT_topology.v | 17 +- theories/topology_theory/subspace_topology.v | 261 +++++++--- theories/topology_theory/subtype_topology.v | 52 +- theories/topology_theory/supremum_topology.v | 41 +- theories/topology_theory/topology_structure.v | 289 +++++++---- theories/topology_theory/uniform_structure.v | 113 +++-- 60 files changed, 2525 insertions(+), 1752 deletions(-) create mode 100644 CHANGELOG_top_displays.md diff --git a/CHANGELOG_top_displays.md b/CHANGELOG_top_displays.md new file mode 100644 index 0000000000..521dc13841 --- /dev/null +++ b/CHANGELOG_top_displays.md @@ -0,0 +1,28 @@ +# Changelog (unreleased) + +## [Unreleased] + +### Added + +- in `filter.v`: + + new definition `with_fdisp`. +- in `function_spaces.v`: + + new definitions `product_uniform_def`, `product_pseudometric_def`, `uniform_topology_def`, `fam_topology_def`. + + new notations `pointwise_continuous` and `uniform_arrow`. +- in `subtype_topology.v`: + + new definition `set_type_topology_def`. + +### Changed + +### Renamed + +### Deprecated + +- in `subspace_topology.v`: + + `from_subspace` (superseded by topology displays) + +### Removed + +### Infrastructure + +### Misc diff --git a/analysis_stdlib/Rstruct_topology.v b/analysis_stdlib/Rstruct_topology.v index c155d7a87e..e31aeb973c 100644 --- a/analysis_stdlib/Rstruct_topology.v +++ b/analysis_stdlib/Rstruct_topology.v @@ -58,7 +58,7 @@ apply iff_sym. have FF : Filter (f @ x)%classic. by typeclasses eauto. (*by apply fmap_filter; apply: @filter_filter' (locally_filter _).*) -case: (@fcvg_ballP _ _ (f @ x)%classic FF (f x)) => {FF}H1 H2. +case: (@fcvg_ballP _ _ _ (f @ x)%classic FF (f x)) => {FF}H1 H2. (* TODO: in need for lemmas and/or refactoring of already existing lemmas (ball vs. Rabs) *) split => [{H2} - /H1 {}H1 eps|{H1} H]. - have {H1} [//|_/posnumP[x0] Hx0] := H1 eps%:num. @@ -100,7 +100,7 @@ Lemma RexpE (x : R) : Rtrigo_def.exp x = expR x. Proof. apply/esym; rewrite /exp /exist_exp; case: Alembert_C3 => y. rewrite /Pser /infinite_sum /= => exp_ub. -rewrite /expR /exp_coeff /series/=; apply: (@cvg_lim R^o) => //. +rewrite /expR /exp_coeff /series/=; apply: (@cvg_lim _ R^o) => //. rewrite -cvg_shiftS /=; apply/cvgrPdist_lt => /= e /RltP /exp_ub[N Nexp_ub]. near=> n. have nN : (n >= N)%coq_nat by apply/ssrnat.leP; near: n; exact: nbhs_infty_ge. @@ -133,13 +133,13 @@ case: exist_cos => y. rewrite /cos_in /cos_n /infinite_sum/=. set G : nat -> R^o := (G in sum_f_R0 G). move=> cos_ub. -have /(@cvg_lim R^o) <- // : series G x @[x --> \oo] --> y. +have /(@cvg_lim _ R^o) <- // : series G x @[x --> \oo] --> y. rewrite -cvg_shiftS/=; apply/cvgrPdist_lt => /= e /RltP /cos_ub[N Ncos_ub]. near=> n. have nN : (n >= N)%coq_nat by apply/ssrnat.leP; near: n; exact: nbhs_infty_ge. move: Ncos_ub => /(_ _ nN) /[!RdistE] /RltP /=. by rewrite /G distrC sum_f_R0E. -apply: (@cvg_lim R^o) => //. +apply: (@cvg_lim _ R^o) => //. suff -> : G = cos_coeff' x by exact: cvg_cos_coeff'. apply/funext=> n; rewrite /G cos_coeff'E cos_coeffE. rewrite odd_double/= mul1r plusE addn0 addnn Rsqr_def !RealsE. diff --git a/analysis_stdlib/showcase/uniform_bigO.v b/analysis_stdlib/showcase/uniform_bigO.v index 05593eb271..74f2d4fcfc 100644 --- a/analysis_stdlib/showcase/uniform_bigO.v +++ b/analysis_stdlib/showcase/uniform_bigO.v @@ -34,7 +34,7 @@ Definition OuP (f : A -> R * R -> R) (g : R * R -> R) := (* first we replace sig with ex and the l^2 norm with the l^oo norm *) -Let normedR2 : normedModType _ := (R^o * R^o)%type. +Let normedR2 : normedModType _ _ := (R^o * R^o)%type. Definition OuPex (f : A -> R * R -> R^o) (g : R * R -> R^o) := exists2 alp, 0 < alp & exists2 C, 0 < C & diff --git a/classical/filter.v b/classical/filter.v index 591459b297..6925e6e2c0 100644 --- a/classical/filter.v +++ b/classical/filter.v @@ -13,26 +13,55 @@ From mathcomp Require Import boolp classical_sets functions wochoice (* element. And lastly it provides typeclass instances for verifying when *) (* a (set_system T) is really a filter in T, as a Filter or Properfilter. *) (* *) +(* ## Filter displays *) +(* *) +(* Similar to orders in MathComp, "filter displays" of type `fdisp_t` are *) +(* associated with every filtered type. These displays can then be used for *) +(* pretty-printing purposes. In the case of topologies, this is useful when *) +(* a single carrier type may be endowed with multiple distinct topologies *) +(* that should be displayed differently. *) +(* *) +(* Much like in MathComp, displays cannot help refine type inference on their *) +(* own : the display is inferred from an alias of the carried type, never the *) +(* other way around. *) +(* *) +(* New filter displays should be defined as opaque terms of type `fdisp_t` *) +(* using the idiom : *) +(* ``` Fact my_display : fdisp_t. Proof. by []. Qed. ``` *) +(* Any additional arguments needed for pretty-printing may be added to this *) +(* declaration. *) +(* *) +(* The type `fdisp_t` has a constructor `default_fdisp` that triggers default *) +(* notations (like any display not associated with custom ones). It should *) +(* preferably be used when a given filtered structure is considered *) +(* "natural", "default" or otherwise does not require custom pretty-printing. *) +(* *) +(* By default, displays are not shown on `nbhs` or later derived notions. *) +(* The module `ExplicitNbhsDisplays` can be imported on demande to add *) +(* disambiguating notations. *) +(* *) (* ## Structure of filter *) (* ``` *) -(* filteredType U == interface type for types whose elements *) -(* represent sets of sets on U *) +(* fdisp_t == type of filter displays *) +(* filteredType d U == interface type for types whose elements *) +(* represent sets of sets on U, with display d *) (* These sets are intended to be filters on U *) (* but this is not enforced yet. *) (* The HB class is called Filtered. *) (* It extends Pointed. *) (* nbhs p == set of sets associated to p (in a filtered *) (* type) *) -(* pfilteredType U == a pointed and filtered type *) +(* pfilteredType d U == a pointed and filtered type *) (* hasNbhs == factory for filteredType *) -(* nbhsType == type of a structure that has a set system *) -(* of neighborhoods associated to each point *) -(* pnbhsType == same has nbhsType for pointed types *) -(* continuous f == f is continuous w.r.t the topology *) -(* isSubNbhs V S U == interface that states the continuity of val *) -(* for U which has a subChoiceType and a *) -(* nbhsType *) -(* subNbhsType V S == structure that extends a *) +(* nbhsType d == type of a structure that has a set system *) +(* of neighborhoods associated to each point, *) +(* with display d *) +(* pnbhsType d == same has nbhsType for pointed types *) +(* continuous f == f is continuous w.r.t the topology *) +(* isSubNbhs d d' V S U == interface that states the continuity of val *) +(* for U which has a `subChoiceType` and a *) +(* `nbhsType d'`, with V being a `nbhsType d`. *) +(* subNbhsType d' V S == structure that extends a *) (* subChoiceType/nbhsType with the isSubNbhs *) (* interface *) (* The HB class is SubNbhs. *) @@ -217,47 +246,82 @@ Reserved Notation "E `@[ x --> F ]" (at level 60, x name, format "E `@[ x --> F ]"). Reserved Notation "f `@ F" (at level 60, format "f `@ F"). -HB.mixin Record isFiltered U T := { +Inductive fdisp_t := default_fdisp. + +Declare Scope fdisp_scope. +Delimit Scope fdisp_scope with fdisp. +Bind Scope fdisp_scope with fdisp_t. + +(* `with_fdisp T` is an alias of `T` with an alternative display *) +Definition with_fdisp (d : fdisp_t) (T : Type) := T. + +HB.mixin Record isFiltered (d : fdisp_t) U T := { nbhs : T -> set_system U }. #[short(type="filteredType")] -HB.structure Definition Filtered (U : Type) := {T of Choice T & isFiltered U T}. -Arguments nbhs {_ _} _ _ : simpl never. +HB.structure Definition Filtered d (U : Type) := + {T of Choice T & isFiltered d U T}. +Arguments nbhs {_ _ _} _ _ : simpl never. #[short(type="pfilteredType")] -HB.structure Definition PointedFiltered (U : Type) := {T of Pointed T & isFiltered U T}. +HB.structure Definition PointedFiltered d (U : Type) := + {T of Pointed T & isFiltered d U T}. + +HB.instance Definition _ d (T : choiceType) := Choice.on (with_fdisp d T). +HB.instance Definition _ d (T : pointedType) := Pointed.on (with_fdisp d T). +HB.instance Definition _ (d : fdisp_t) T (S : pred T) (U : subChoiceType S) + := SubChoice.on (with_fdisp d U). +HB.instance Definition _ d d' U (T : filteredType d U) := + isFiltered.Build d' U (with_fdisp d' T) nbhs. HB.instance Definition _ T := Equality.on (set_system T). HB.instance Definition _ T := Choice.on (set_system T). HB.instance Definition _ T := Pointed.on (set_system T). -HB.instance Definition _ T := isFiltered.Build T (set_system T) id. +HB.instance Definition _ T := + isFiltered.Build default_fdisp T (set_system T) id. HB.mixin Record selfFiltered T := {}. -HB.factory Record hasNbhs T := { nbhs : T -> set_system T }. -HB.builders Context T & hasNbhs T. - HB.instance Definition _ := isFiltered.Build T T nbhs. +HB.factory Record hasNbhs (d : fdisp_t) T := { nbhs : T -> set_system T }. +HB.builders Context d T & hasNbhs d T. + HB.instance Definition _ := isFiltered.Build d T T nbhs. HB.instance Definition _ := selfFiltered.Build T. HB.end. #[short(type="nbhsType")] -HB.structure Definition Nbhs := {T of Choice T & hasNbhs T}. +HB.structure Definition Nbhs d := {T of Choice T & hasNbhs d T}. #[short(type="pnbhsType")] -HB.structure Definition PointedNbhs := {T of Pointed T & hasNbhs T}. +HB.structure Definition PointedNbhs d := {T of Pointed T & hasNbhs d T}. + +HB.instance Definition _ (d d' : fdisp_t) (T : nbhsType d) := + hasNbhs.Build d' (with_fdisp d' T) (@nbhs _ _ T). +HB.saturate with_fdisp. + +Module ExplicitNbhsDisplays. + +Notation "d .-nbhs" := + (@nbhs d _ _) (at level 5, format "d '.-nbhs'"). +Notation "'nbhs'" := + (@nbhs default_fdisp _ _) + (only printing). + +End ExplicitNbhsDisplays. Definition filter_from {I T : Type} (D : set I) (B : I -> set T) : set_system T := [set P | exists2 i, D i & B i `<=` P]. (* the canonical filter on matrices on X is the product of the canonical filter on X *) -HB.instance Definition _ m n X (Z : filteredType X) := - isFiltered.Build 'M[X]_(m, n) 'M[Z]_(m, n) (fun mx => filter_from +HB.instance Definition _ m n d X (Z : filteredType d X) := + isFiltered.Build default_fdisp + 'M[X]_(m, n) 'M[Z]_(m, n) (fun mx => filter_from [set P | forall i j, nbhs (mx i j) (P i j)] (fun P => [set my : 'M[X]_(m, n) | forall i j, P i j (my i j)])). -HB.instance Definition _ m n (X : nbhsType) := selfFiltered.Build 'M[X]_(m, n). +HB.instance Definition _ m n d (X : nbhsType d) := + selfFiltered.Build 'M[X]_(m, n). Definition filter_prod {T U : Type} (F : set_system T) (G : set_system U) : set_system (T * U) := @@ -270,19 +334,20 @@ Local Notation "{ 'all2' P }" := (forall x y, P x y : Prop) (at level 0). Local Notation "{ 'all3' P }" := (forall x y z, P x y z: Prop) (at level 0). Local Notation ph := (phantom _). -Definition prop_near1 {X} {fX : filteredType X} (x : fX) +Definition prop_near1 {d X} {fX : filteredType d X} (x : fX) P (phP : ph {all1 P}) := nbhs x P. -Definition prop_near2 {X X'} {fX : filteredType X} {fX' : filteredType X'} +Definition prop_near2 {d d' X X'} + {fX : filteredType d X} {fX' : filteredType d' X'} (x : fX) (x' : fX') := fun P & ph {all2 P} => filter_prod (nbhs x) (nbhs x') (fun x => P x.1 x.2). - End Near. -Notation "{ 'near' x , P }" := (@prop_near1 _ _ x _ (inPhantom P)) : type_scope. +Notation "{ 'near' x , P }" := + (@prop_near1 _ _ _ x _ (inPhantom P)) : type_scope. Notation "'\forall' x '\near' x_0 , P" := {near x_0, forall x, P} : type_scope. Notation "{ 'near' x & y , P }" := - (@prop_near2 _ _ _ _ x y _ (inPhantom P)) : type_scope. + (@prop_near2 _ _ _ _ _ _ x y _ (inPhantom P)) : type_scope. Notation "'\forall' x '\near' x_0 & y '\near' y_0 , P" := {near x_0 & y_0, forall x y, P} : type_scope. Notation "'\forall' x & y '\near' z , P" := @@ -320,10 +385,10 @@ Proof. by move=> FG GH P /GH /FG. Qed. Notation "F --> G" := (cvg_to (nbhs F) (nbhs G)) : classical_set_scope. Definition type_of_filter {T} (F : set_system T) := T. -Definition lim_in {U : Type} (T : pfilteredType U) := +Definition lim_in d {U : Type} (T : pfilteredType d U) := fun F : set_system U => get (fun l : T => F --> l). -Notation "[ 'lim' F 'in' T ]" := (@lim_in _ T (nbhs F)) : classical_set_scope. -Definition lim {T : pnbhsType} (F : set_system T) := [lim F in T]. +Notation "[ 'lim' F 'in' T ]" := (@lim_in _ _ T (nbhs F)) : classical_set_scope. +Definition lim d {T : pnbhsType d} (F : set_system T) := [lim F in T]. Notation "[ 'cvg' F 'in' T ]" := (F --> [lim F in T]) : classical_set_scope. Notation cvg F := (F --> lim F). @@ -331,71 +396,82 @@ Notation cvg F := (F --> lim F). Definition eventually := filter_from setT (fun N => [set n | (N <= n)%N]). Notation "'\oo'" := eventually : classical_set_scope. +Fact prod_fdisp (d1 d2 : fdisp_t) : fdisp_t. +Proof. by []. Qed. + +Notation "'prod'" := (prod_fdisp _ _) (only printing) : fdisp_scope. + Section FilteredTheory. -HB.instance Definition _ X1 X2 (Z1 : filteredType X1) (Z2 : filteredType X2) := - isFiltered.Build (X1 * X2)%type (Z1 * Z2)%type +HB.instance Definition _ d1 d2 X1 X2 + (Z1 : filteredType d1 X1) (Z2 : filteredType d2 X2) := + isFiltered.Build (prod_fdisp d1 d2) (X1 * X2)%type (Z1 * Z2)%type (fun x => filter_prod (nbhs x.1) (nbhs x.2)). -HB.instance Definition _ (X1 X2 : nbhsType) := +HB.instance Definition _ d1 d2 (X1 : nbhsType d1) (X2 : nbhsType d2) := selfFiltered.Build (X1 * X2)%type. -Lemma cvg_prod T {U U' V V' : filteredType T} (x : U) (l : U') (y : V) (k : V') : +Lemma cvg_prod {d1 d1' d2 d2'} T + {U : filteredType d1 T} {U' : filteredType d1' T} + {V : filteredType d2 T} {V' : filteredType d2' T} + (x : U) (l : U') (y : V) (k : V') : x --> l -> y --> k -> (x, y) --> (l, k). Proof. move=> xl yk X [[X1 X2] /= [HX1 HX2] H]; exists (X1, X2) => //=. split; [exact: xl | exact: yk]. Qed. -Lemma cvg_in_ex {U : Type} (T : pfilteredType U) (F : set_system U) : +Lemma cvg_in_ex {d} {U : Type} (T : pfilteredType d U) (F : set_system U) : [cvg F in T] <-> (exists l : T, F --> l). Proof. by split=> [cvg|/getPex//]; exists [lim F in T]. Qed. -Lemma cvg_ex (T : pnbhsType) (F : set_system T) : +Lemma cvg_ex {d} (T : pnbhsType d) (F : set_system T) : cvg F <-> (exists l : T, F --> l). Proof. exact: cvg_in_ex. Qed. -Lemma cvg_inP {U : Type} (T : pfilteredType U) (F : set_system U) (l : T) : - F --> l -> [cvg F in T]. +Lemma cvg_inP {d} {U : Type} (T : pfilteredType d U) (F : set_system U) + (l : T) : F --> l -> [cvg F in T]. Proof. by move=> Fl; apply/cvg_in_ex; exists l. Qed. -Lemma cvgP (T : pnbhsType) (F : set_system T) (l : T) : F --> l -> cvg F. +Lemma cvgP {d} (T : pnbhsType d) (F : set_system T) (l : T) : F --> l -> cvg F. Proof. exact: cvg_inP. Qed. -Lemma cvg_in_toP {U : Type} (T : pfilteredType U) (F : set_system U) (l : T) : +Lemma cvg_in_toP {d} {U : Type} (T : pfilteredType d U) + (F : set_system U) (l : T) : [cvg F in T] -> [lim F in T] = l -> F --> l. Proof. by move=> /[swap]->. Qed. -Lemma cvg_toP (T : pnbhsType) (F : set_system T) (l : T) : +Lemma cvg_toP {d} (T : pnbhsType d) (F : set_system T) (l : T) : cvg F -> lim F = l -> F --> l. Proof. exact: cvg_in_toP. Qed. -Lemma dvg_inP {U : Type} (T : pfilteredType U) (F : set_system U) : +Lemma dvg_inP {d} {U : Type} (T : pfilteredType d U) (F : set_system U) : ~ [cvg F in T] -> [lim F in T] = point. Proof. by rewrite /lim_in /=; case xgetP. Qed. -Lemma dvgP (T : pnbhsType) (F : set_system T) : ~ cvg F -> lim F = point. +Lemma dvgP {d} (T : pnbhsType d) (F : set_system T) : ~ cvg F -> lim F = point. Proof. exact: dvg_inP. Qed. -Lemma cvg_inNpoint {U} (T : pfilteredType U) (F : set_system U) : +Lemma cvg_inNpoint {d} {U} (T : pfilteredType d U) (F : set_system U) : [lim F in T] != point -> [cvg F in T]. Proof. by apply: contra_neqP; apply: dvg_inP. Qed. -Lemma cvgNpoint (T : pnbhsType) (F : set_system T) : lim F != point -> cvg F. +Lemma cvgNpoint {d} (T : pnbhsType d) (F : set_system T) : + lim F != point -> cvg F. Proof. exact: cvg_inNpoint. Qed. End FilteredTheory. -Arguments cvg_inP {U T F} l. -Arguments dvg_inP {U} T {F}. -Arguments cvgP {T F} l. -Arguments dvgP {T F}. +Arguments cvg_inP {d U T F} l. +Arguments dvg_inP {d U} T {F}. +Arguments cvgP {d T F} l. +Arguments dvgP {d T F}. -Lemma nbhs_nearE {U} {T : filteredType U} (x : T) (P : set U) : +Lemma nbhs_nearE {d U} {T : filteredType d U} (x : T) (P : set U) : nbhs x P = \forall x0 \near x, P x0. Proof. by []. Qed. -Lemma near_nbhs {U} {T : filteredType U} (x : T) (P : set U) : - (\forall x0 \near nbhs x, P x0) = (\forall x0 \near x, P x0). +Lemma near_nbhs {d U} {T : filteredType d U} (x : T) (P : set U) : + (\forall x \near nbhs x, P x) = (\forall x0 \near x, P x0). Proof. by []. Qed. Lemma near2_curry {U V} (F : set_system U) (G : set_system V) (P : U -> set V) : @@ -408,9 +484,9 @@ Proof. by symmetry; congr (nbhs _); rewrite predeqE => -[]. Qed. Definition near2E := (@near2_curry, @near2_pair). -Lemma filter_of_nearI (X : Type) (fX : filteredType X) +Lemma filter_of_nearI d (X : Type) (fX : filteredType d X) (x : fX) : forall P, - nbhs x P = @prop_near1 X fX x P (inPhantom (forall x, P x)). + nbhs x P = @prop_near1 d X fX x P (inPhantom (forall x, P x)). Proof. by []. Qed. Module Export NearNbhs. @@ -486,7 +562,8 @@ HB.instance Definition _ T := gen_eqMixin (filter_on T). HB.instance Definition _ T := gen_choiceMixin (filter_on T). HB.instance Definition _ T := isPointed.Build (filter_on T) (FilterType _ (filter_setT T)). -HB.instance Definition _ T := isFiltered.Build T (filter_on T) (@filter T). +HB.instance Definition _ T := + isFiltered.Build default_fdisp T (filter_on T) (@filter T). Global Instance filter_on_Filter T (F : filter_on T) : Filter F. Proof. by case: F. Qed. @@ -627,10 +704,10 @@ Ltac done := | match goal with H : ~ _ |- _ => solve [case H; trivial] end | match goal with |- ?x \is_near _ => near: x; apply: prop_ofP end ]. -Lemma have_near (U : Type) (fT : filteredType U) (x : fT) (P : Prop) : +Lemma have_near d (U : Type) (fT : filteredType d U) (x : fT) (P : Prop) : ProperFilter (nbhs x) -> (\forall x \near x, P) -> P. Proof. by move=> FF nP; have [] := @filter_ex _ _ FF (fun=> P). Qed. -Arguments have_near {U fT} x. +Arguments have_near {d U fT} x. Tactic Notation "near" constr(F) "=>" ident(x) := apply: (have_near F); near=> x. @@ -924,22 +1001,23 @@ Lemma eq_cvg (T U : Type) (F : set_system T) (f g : T -> U) (x : set_system U) : f =1 g -> (f @ F --> x) = (g @ F --> x). Proof. by move=> /funext->. Qed. -Lemma near_eq_is_cvg (T : Type) (U : pnbhsType) (F : set_system T) +Lemma near_eq_is_cvg d (T : Type) (U : pnbhsType d) (F : set_system T) (f g : T -> U) : Filter F -> {near F, f =1 g} -> cvg (f x @[x --> F]) -> cvg(g x @[x --> F]). Proof. by move=> FF /near_eq_cvg_eq ->. Qed. -Lemma eq_is_cvg_in (T U : Type) (fT : pfilteredType U) (F : set_system T) +Lemma eq_is_cvg_in d (T U : Type) (fT : pfilteredType d U) (F : set_system T) (f g : T -> U) : f =1 g -> [cvg (f @ F) in fT] = [cvg (g @ F) in fT]. Proof. by move=> /funext ->. Qed. -Lemma eq_is_cvg (T : Type) (U : pnbhsType) (F : set_system T) (f g : T -> U) : +Lemma eq_is_cvg d (T : Type) (U : pnbhsType d) (F : set_system T) + (f g : T -> U) : f =1 g -> cvg (f @ F) = cvg (g @ F). Proof. by move=> /funext->. Qed. -Lemma near_eq_lim (T : Type) (U : pnbhsType) {F : set_system T} {FF : Filter F} - (f g : T -> U) : +Lemma near_eq_lim d (T : Type) (U : pnbhsType d) + {F : set_system T} {FF : Filter F} (f g : T -> U) : {near F, f =1 g} -> lim (f @ F) = lim (g @ F). Proof. by move=> /near_eq_cvg_eq ->. Qed. @@ -958,29 +1036,32 @@ move=> FF FG fFG P /= GP; rewrite !near_simpl; apply: (have_near G). by apply: filter_app fFG; near do apply: filterS => x /= ->. Unshelve. all: by end_near. Qed. -Definition continuous_at (T U : nbhsType) (x : T) (f : T -> U) := - (f%function @ x --> f%function x). +Definition continuous_at d d' (T : nbhsType d) (U : nbhsType d') + (x : T) (f : T -> U) := (f%function @ x --> f%function x). Notation continuous f := (forall x, continuous_at x f). -Lemma continuous_comp (R S T : nbhsType) (f : R -> S) (g : S -> T) x : +Lemma continuous_comp d d' d'' + (R : nbhsType d) (S : nbhsType d') (T : nbhsType d'') + (f : R -> S) (g : S -> T) x : {for x, continuous f} -> {for (f x), continuous g} -> {for x, continuous (g \o f)}. Proof. exact: cvg_comp. Qed. HB.mixin Record isSubNbhs - (V : nbhsType) (S : pred V) U & SubChoice V S U & Nbhs U := { + d d' (V : nbhsType d) (S : pred V) U & SubChoice V S U & Nbhs d' U := { continuous_valE : continuous (val : U -> V) }. #[short(type="subNbhsType")] -HB.structure Definition SubNbhs (V : nbhsType) (S : pred V) := - { U of SubChoice V S U & Nbhs U & isSubNbhs V S U}. +HB.structure Definition SubNbhs d d' (V : nbhsType d) (S : pred V) := + { U of SubChoice V S U & Nbhs d' U & isSubNbhs d d' V S U}. -Lemma near_fun (T T' : nbhsType) (f : T -> T') (x : T) (P : T' -> Prop) : +Lemma near_fun d d' (T : nbhsType d) (T' : nbhsType d') + (f : T -> T') (x : T) (P : T' -> Prop) : {for x, continuous f} -> (\forall y \near f x, P y) -> (\forall x0 \near x, P (f x0)). Proof. exact. Qed. -Arguments near_fun {T T'} f x. +Arguments near_fun {d d' T T'} f x. (* globally filter *) @@ -1373,7 +1454,7 @@ HB.instance Definition _ (P : choiceType) := HB.instance Definition _ (P : pointedType) := Pointed.on (principal_filter_type P). HB.instance Definition _ (P : choiceType) := - hasNbhs.Build (principal_filter_type P) principal_filter. + hasNbhs.Build default_fdisp (principal_filter_type P) principal_filter. HB.instance Definition _ (P : pointedType) := Filtered.on (principal_filter_type P). @@ -1383,7 +1464,8 @@ Proof. by split=> [|? ? ->]; [exact|]. Qed. Lemma principal_filter_proper {X} (x : X) : ProperFilter (principal_filter x). Proof. exact: globally_properfilter. Qed. -HB.instance Definition _ := hasNbhs.Build bool principal_filter. +HB.instance Definition _ := + hasNbhs.Build default_fdisp bool principal_filter. End PrincipalFilters. diff --git a/theories/borel_hierarchy.v b/theories/borel_hierarchy.v index 880301fbe7..56682c1523 100644 --- a/theories/borel_hierarchy.v +++ b/theories/borel_hierarchy.v @@ -25,7 +25,7 @@ Import numFieldNormedType.Exports. Local Open Scope classical_set_scope. Section Gdelta_Fsigma. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Implicit Type S : set T. Definition Gdelta S := diff --git a/theories/cantor.v b/theories/cantor.v index d579ce31ea..77dbd669e5 100644 --- a/theories/cantor.v +++ b/theories/cantor.v @@ -53,7 +53,7 @@ HB.instance Definition _ := Nbhs.on cantor_space. HB.instance Definition _ := Topological.on cantor_space. HB.instance Definition _ := Uniform.on cantor_space. -Definition cantor_like (T : topologicalType) := +Definition cantor_like d (T : topologicalType d) := [/\ perfect_set [set: T], compact [set: T], hausdorff_space T & @@ -61,7 +61,7 @@ Definition cantor_like (T : topologicalType) := Lemma cantor_space_compact : compact [set: cantor_space]. Proof. -have := @tychonoff _ (fun _ : nat => _) _ (fun=> bool_compact). +have := @tychonoff _ _ (fun _ : nat => _) _ (fun=> bool_compact). by congr (compact _); rewrite eqEsubset. Qed. @@ -103,7 +103,7 @@ Qed. (* *) (******************************************************************************) Section topological_trees. -Context {K : nat -> pdiscreteTopologicalType} {X : ptopologicalType} +Context {d d'} {K : nat -> pdiscreteTopologicalType d} {X : ptopologicalType d'} (refine_apx : forall n, set X -> K n -> set X) (tree_invariant : set X -> Prop). @@ -122,7 +122,7 @@ Hypothesis refine_separates: forall x y : X, x != y -> Let refine_subset n U e : @refine_apx n U e `<=` U. Proof. by rewrite [X in _ `<=` X](refine_cover n); exact: bigcup_sup. Qed. -Let T := prod_topology (K : nat -> ptopologicalType). +Let T := prod_topology (K : nat -> ptopologicalType d). Local Fixpoint branch_apx (b : T) n := if n is m.+1 then refine_apx (branch_apx b m) (b m) else [set: X]. @@ -191,7 +191,7 @@ Proof. elim: n => [|n IH]; first by near=> z => ?; rewrite ltn0. near=> z => i; rewrite leq_eqVlt => /predU1P[|iSn]; last by rewrite (near IH z). move=> [->]; near: z; exists (proj n @^-1` [set b n]). -split => //; suff : @open T (proj n @^-1` [set b n]) by []. +split => //; suff : @open _ T (proj n @^-1` [set b n]) by []. apply: open_comp; [move=> + _; exact: proj_continuous| apply: discrete_open]. Unshelve. all: end_near. Qed. @@ -204,7 +204,7 @@ Qed. Let tree_map_apx b n : branch_apx b n (tree_map b). Proof. -apply: (@closed_cvg _ _ _ (tree_map_filter b)); last exact: cvg_tree_map. +apply: (@closed_cvg _ _ _ _ (tree_map_filter b)); last exact: cvg_tree_map. by apply: invar_cl; exact: tree_map_invar. by exists n. Qed. @@ -257,13 +257,13 @@ End topological_trees. (******************************************************************************) Section TreeStructure. -Context {R : realType} {T : pseudoPMetricType R}. +Context {d} {R : realType} {T : pseudoPMetricType d R}. Hypothesis cantorT : cantor_like T. Let dsctT : zero_dimensional T. Proof. by case: cantorT. Qed. Let pftT : perfect_set [set: T]. Proof. by case: cantorT. Qed. Let cmptT : compact [set: T]. Proof. by case: cantorT. Qed. -Let hsdfT : @hausdorff_space T. Proof. by case: cantorT. Qed. +Let hsdfT : hausdorff_space T. Proof. by case: cantorT. Qed. Let c_invar (U : set T) := clopen U /\ U !=set0. @@ -292,7 +292,7 @@ Local Lemma cantor_map : exists f : cantor_space -> T, set_surj [set: cantor_space] [set: T] f & set_inj [set: cantor_space] f ]. Proof. -have [] := @tree_map_props (fun=> bool) T c_ind c_invar cmptT hsdfT. +have [] := @tree_map_props _ _ (fun=> bool) T c_ind c_invar cmptT hsdfT. - move=> n V; rewrite eqEsubset; split => [t Vt|t [? ? []]//]. have [?|?] := pselect ((U_ n `&` V !=set0) /\ ~` U_ n `&` V !=set0). + have [Unt|Unt] := pselect (U_ n t). @@ -340,8 +340,9 @@ Proof. exists tree_map => /=. have [cts surj inje] := projT2 (cid cantor_map); split; first exact: cts. move=> A clA; apply: (compact_closed hsdfT). -apply: (@continuous_compact _ _ tree_map); first exact: continuous_subspaceT. -apply: (@subclosed_compact _ _ [set: cantor_space]) => //. +apply: (@continuous_compact _ _ _ _ tree_map). + exact: continuous_subspaceT. +apply: (@subclosed_compact _ _ _ [set: cantor_space]) => //. exact: cantor_space_compact. Qed. @@ -364,21 +365,21 @@ HB.instance Definition _ (T : nat -> pointedType) : Pointed (tree_of T):= HB.instance Definition _ (T : nat -> pointedType) := Uniform.on (tree_of T). HB.instance Definition _ (T : nat -> pointedType) : - @PseudoMetric R _ := + @PseudoMetric _ R _ := @PseudoMetric.on (tree_of T). -Lemma cantor_like_finite_prod (T : nat -> ptopologicalType) : +Lemma cantor_like_finite_prod d (T : nat -> ptopologicalType d) : (forall n, finite_set [set: discrete_topology (T n)]) -> (forall n, (exists xy : T n * T n, xy.1 != xy.2)) -> cantor_like (tree_of T). Proof. move=> finiteT twoElems; split. -- exact/(@perfect_diagonal (discrete_topology \o T))/twoElems. +- exact/(@perfect_diagonal _ (discrete_topology \o T))/twoElems. - have := tychonoff (fun n => finite_compact (finiteT n)). set A := (X in compact X -> _). suff : A = [set: tree_of (fun x : nat => T x)] by move=> ->. by rewrite eqEsubset. -- apply: (@hausdorff_product _ (discrete_topology \o T)) => n. +- apply: (@hausdorff_product _ _ (discrete_topology \o T)) => n. by apply: discrete_hausdorff; exact: discrete_space_discrete. - apply: zero_dimension_prod => ?; apply: discrete_zero_dimension. Qed. @@ -389,7 +390,7 @@ End FinitelyBranchingTrees. (* ## Part 4: Building a finitely branching tree to cover `T` *) (******************************************************************************) Section alexandroff_hausdorff. -Context {T : pseudoPMetricType R}. +Context {d} {T : pseudoPMetricType d R}. Hypothesis cptT : compact [set: T]. Hypothesis hsdfT : hausdorff_space T. @@ -440,7 +441,7 @@ Qed. Let ent_balls E := projT1 (cid (ent_balls' E)). Let count_unif' := cid2 - ((iffLR countable_uniformityP) (@countable_uniformity_metric _ T)). + ((iffLR countable_uniformityP) (@countable_uniformity_metric _ _ T)). Let count_unif := projT1 count_unif'. @@ -495,7 +496,7 @@ Local Lemma cantor_surj_pt1 : exists2 f : Tree -> T, Proof. pose entn n := projT2 (cid (ent_balls' (count_unif n))). have [ | |? []//| |? []// | |] := @tree_map_props - K T (embed_refine) (embed_invar) cptT hsdfT. + _ _ K T (embed_refine) (embed_invar) cptT hsdfT. - move=> n U; rewrite eqEsubset; split=> [t Ut|t [? ? []]//]. have [//|_ _ _ + _] := entn n; rewrite -subTset. move=> /(_ t I)[W cbW Wt]; exists (existT _ W cbW) => //. @@ -526,15 +527,15 @@ have [ | |? []//| |? []// | |] := @tree_map_props have [z [Dz DzE]] := Csub _ cbD. have /ent_closure := DzE _ Dx => /(_ (ent_count_unif n))/xsectionP/ctE [_ /= Exz]. have /ent_closure := DzE _ Dy => /(_ (ent_count_unif n))/xsectionP/ctE [Ezy _]. - exact: (@entourage_split T z). + exact: (@entourage_split _ T z). by move=> f [ctsf surjf _]; exists f. Qed. Local Lemma cantor_surj_pt2 : exists f : {surj [set: cantor_space] >-> [set: Tree]}, continuous f. Proof. -have [|f [ctsf _]] := @homeomorphism_cantor_like R Tree; last by exists f. -apply: (@cantor_like_finite_prod (discrete_topology \o K)) => [n /=|n]. +have [|f [ctsf _]] := @homeomorphism_cantor_like _ R Tree; last by exists f. +apply: (@cantor_like_finite_prod _ (discrete_topology \o K)) => [n /=|n]. have [//| fs _ _ _ _] := projT2 (cid (ent_balls' (count_unif n))). suff -> : [set: {classic K' n}] = (@projT1 (set T) _) @^-1` (projT1 (cid (ent_balls' (count_unif n)))). diff --git a/theories/derive.v b/theories/derive.v index 81ac4de198..df721e12d0 100644 --- a/theories/derive.v +++ b/theories/derive.v @@ -128,7 +128,8 @@ Reserved Notation "f ^` ()" (format "f ^` ()"). Reserved Notation "f ^` ( n )" (format "f ^` ( n )"). Section Differential. -Context {K : numDomainType} {V W : normedModType K}. +Context {d d'} {K : numDomainType} + {V : normedModType d K} {W : normedModType d' K}. Definition diff (F : filter_on V) (_ : phantom (set_system V) F) (f : V -> W) := (get (fun (df : {linear V -> W}) => continuous df /\ forall x, @@ -183,12 +184,13 @@ Unshelve. all: by end_near. Qed. End Differential. Section Differential_numFieldType. -Context {K : numFieldType (*TODO: to numDomainType?*)} {V W : normedModType K}. +Context {d d'} {K : numFieldType (*TODO: to numDomainType?*)} + {V : normedModType d K} {W : normedModType d' K}. (* duplicate from Section Differential *) Local Notation differentiable f F := - (@differentiable_def _ _ _ f _ (Phantom _ (nbhs F))). -Local Notation "''d' f x" := (@diff _ _ _ _ (Phantom _ (nbhs x)) f). + (@differentiable_def _ _ _ _ _ f _ (Phantom _ (nbhs F))). +Local Notation "''d' f x" := (@diff _ _ _ _ _ _ (Phantom _ (nbhs x)) f). Hint Extern 0 (continuous _) => solve[now apply: diff_continuous] : core. Lemma diff_locallyxP (x : V) (f : V -> W) : @@ -224,15 +226,17 @@ Proof. by move=> /diff_locallyP []. Qed. End Differential_numFieldType. -Notation "''d' f F" := (@diff _ _ _ _ (Phantom _ (nbhs F)) f). -Notation differentiable f F := (@differentiable_def _ _ _ f _ (Phantom _ (nbhs F))). +Notation "''d' f F" := (@diff _ _ _ _ _ _ (Phantom _ (nbhs F)) f). +Notation differentiable f F := + (@differentiable_def _ _ _ _ _ f _ (Phantom _ (nbhs F))). Notation "'is_diff' F" := (is_diff_def (Phantom _ (nbhs F))). #[global] Hint Extern 0 (differentiable _ _) => solve[apply: ex_diff] : core. #[global] Hint Extern 0 ({for _, continuous _}) => solve[now apply: diff_continuous] : core. -Lemma differentiableP (R : numDomainType) (V W : normedModType R) (f : V -> W) x : +Lemma differentiableP d d' (R : numDomainType) + (V : normedModType d R) (W : normedModType d' R) (f : V -> W) x : differentiable f x -> is_diff x f ('d f x). Proof. by move=> ?; apply: DiffDef. Qed. @@ -247,7 +251,8 @@ Notation "''J' f p" := (jacobian f p). Section DifferentialR. -Context {R : numFieldType} {V W : normedModType R}. +Context {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R}. (* split in multiple bits: - a linear map which is locally bounded is a little o of 1 @@ -264,7 +269,8 @@ by apply/eqolim0P; apply: (cvg_trans (dfc 0)); rewrite linear0. Unshelve. all: by end_near. Qed. Section littleo_lemmas. -Context {X Y Z : normedModType R}. +Context {d1 d2 d3} + {X : normedModType d1 R} {Y : normedModType d2 R} {Z : normedModType d3 R}. Lemma normm_littleo x (f : X -> Y) : `| [o_(x \near x) (1 : R) of f x]| = 0. Proof. @@ -339,7 +345,7 @@ Lemma derivable_nbhsP (f : V -> W) a v : Proof. split; first exact: derivable_nbhs. move=> df; apply/cvg_ex; exists ('D_v f a). -apply/(@eqolimP _ _ _ (dnbhs_filter_on _))/eqaddoP => _/posnumP[e]. +apply/(@eqolimP _ _ _ _ (dnbhs_filter_on _))/eqaddoP => _/posnumP[e]. have /eqaddoP /(_ e%:num) /(_ [gt0 of e%:num]) := df. rewrite /= !(near_simpl, near_withinE); apply: filter_app; near=> h. rewrite /= opprD -![(_ + _ : _ -> _) _]/(_ + _) -![(- _ : _ -> _) _]/(- _). @@ -390,7 +396,8 @@ Notation "''D_' v f c" := (derive f c v). (* printing *) #[global] Hint Extern 0 (derivable _ _ _) => solve[apply: ex_derive] : core. Section DifferentialR_numFieldType. -Context {R : numFieldType} {V W : normedModType R}. +Context {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R}. Lemma deriveE (f : V -> W) (a v : V) : differentiable f a -> 'D_v f a = 'd f a v. @@ -430,8 +437,8 @@ Qed. End DifferentialR_numFieldType. Section DifferentialR2. -Context {R : numFieldType}. -Implicit Type V : normedModType R. +Context {d : fdisp_t} {R : numFieldType}. +Implicit Type V : normedModType d R. Lemma deriveEjacobian m n (f : 'rV[R]_m -> 'rV[R]_n) (a v : 'rV[R]_m) : differentiable f a -> 'D_ v f a = v *m jacobian f a. @@ -444,8 +451,10 @@ Local Notation "f ^` ()" := (derive1 f). Lemma derive1E V (f : R -> V) a : f^`() a = 'D_1 f a. Proof. -rewrite /derive1 /derive; set d := (fun _ : R => _); set d' := (fun _ : R => _). -by suff -> : d = d' by []; rewrite funeqE=> h; rewrite /d /d' /= [h%:A](mulr1). +rewrite /derive1 /derive. +set df := (fun _ : R => _); set df' := (fun _ : R => _). +suff -> : df = df' by []; rewrite funeqE=> h. +by rewrite /df /df' /= [h%:A](mulr1). Qed. (* Is it necessary? *) @@ -481,7 +490,8 @@ Notation derivemxE := deriveEjacobian (only parsing). Section DifferentialR3. Context {R : numFieldType}. -Fact dcst (V W : normedModType R) (a : W) (x : V) : continuous (0 : V -> W) /\ +Fact dcst {d d'} + {V : normedModType d R} {W : normedModType d' R} (a : W) (x : V) : continuous (0 : V -> W) /\ cst a \o shift x = cst (cst a x) + \0 +o_ 0 id. Proof. split; first exact: cst_continuous. @@ -489,7 +499,7 @@ apply/eqaddoE; rewrite addr0 funeqE => ? /=; rewrite -[LHS]addr0; congr (_ + _). by rewrite littleoE; first exact: littleo0_subproof. Qed. -Variables (V W : normedModType R). +Context {d d'} (V : normedModType d R) (W : normedModType d' R). Fact dadd (f g : V -> W) x : differentiable f x -> differentiable g x -> @@ -497,7 +507,7 @@ Fact dadd (f g : V -> W) x : (f + g) \o shift x = cst ((f + g) x) + ('d f x \+ 'd g x) +o_ 0 id. Proof. move=> df dg; split => [?|]; do ?exact: continuousD. -apply/(@eqaddoE R); rewrite funeqE => y /=. +apply/(@eqaddoE _ _ R); rewrite funeqE => y /=. by rewrite !fctE ![_ (_ + x)]diff_locallyx// addrACA addox addrACA. Qed. @@ -510,7 +520,8 @@ apply/eqaddoE; rewrite funeqE => y /=. by rewrite -[(- f) _]/(- (_ _)) diff_locallyx// !opprD oppox. Qed. -Lemma is_diff_eq (V' W' : normedModType R) (f f' g : V' -> W') (x : V') : +Lemma is_diff_eq d0 d0' (V' : normedModType d0 R) (W' : normedModType d0' R) + (f f' g : V' -> W') (x : V') : is_diff x f f' -> f' = g -> is_diff x f g. Proof. by move=> ? <-. Qed. @@ -536,7 +547,11 @@ apply/eqaddoE; rewrite funeqE => y /=. by rewrite diff_locallyx //= !scalerDl scaleolx. Qed. -Fact dlin (V' W' : normedModType R) (f : {linear V' -> W'}) x : +Context {d0 d0' d0'' : fdisp_t}. +Implicit Types (U : normedModType d0 R) (V : normedModType d0' R) + (W : normedModType d0'' R). + +Fact dlin V' W' (f : {linear V' -> W'}) x : continuous f -> f \o shift x = cst (f x) + f +o_ 0 id. Proof. move=> df; apply: eqaddoE; rewrite funeqE => y /=. @@ -545,34 +560,33 @@ by rewrite littleoE; first exact: littleo0_subproof. (*fixme*) Qed. (* TODO: generalize *) -Lemma compoO_eqo (U V' W' : normedModType R) (f : U -> V') - (g : V' -> W') : +Lemma compoO_eqo U V' W' (f : U -> V') (g : V' -> W') : [o_ 0 id of g] \o [O_ 0 id of f] =o_ 0 id. Proof. apply/eqoP => _ /posnumP[e]. have /bigO_exP [_ /posnumP[k]] := bigOP [bigO of [O_ 0 id of f]]. have := littleoP [littleo of [o_ 0 id of g]]. -move=> /(_ (e%:num / k%:num)) /(_ _) /nbhs_ballP [//|_ /posnumP[d] hd]. -apply: filter_app; near=> x => leOxkx; apply: le_trans (hd _ _) _; last first. +move=> /(_ (e%:num / k%:num)) /(_ _) /nbhs_ballP [//|_ /posnumP[e'] he']. +apply: filter_app; near=> x => leOxkx; apply: le_trans (he' _ _) _; last first. by rewrite -ler_pdivlMl // invf_div mulrA divfK. by rewrite -ball_normE /= distrC subr0 (le_lt_trans leOxkx) // -ltr_pdivlMl. Unshelve. all: by end_near. Qed. -Lemma compoO_eqox (U V' W' : normedModType R) (f : U -> V') +Lemma compoO_eqox U V' W' (f : U -> V') (g : V' -> W') : forall x : U, [o_ 0 id of g] ([O_ 0 id of f] x) =o_(x \near 0) x. Proof. by move=> x; rewrite -[LHS]/((_ \o _) x) compoO_eqo. Qed. (* TODO: generalize *) -Lemma compOo_eqo (U V' W' : normedModType R) (f : U -> V') (g : V' -> W') : +Lemma compOo_eqo U V' W' (f : U -> V') (g : V' -> W') : [O_ 0 id of g] \o [o_ 0 id of f] =o_ 0 id. Proof. apply/eqoP => _ /posnumP[e]. have /bigO_exP [_ /posnumP[k]] := bigOP [bigO of [O_ 0 id of g]]. -move=> /nbhs_ballP [_ /posnumP[d] hd]. +move=> /nbhs_ballP [_ /posnumP[e'] he']. have ekgt0 : e%:num / k%:num > 0 by []. have /(_ _ ekgt0) := littleoP [littleo of [o_ 0 id of f]]. -apply: filter_app; near=> x => leoxekx; apply: le_trans (hd _ _) _; last first. +apply: filter_app; near=> x => leoxekx; apply: le_trans (he' _ _) _; last first. by rewrite -ler_pdivlMl // mulrA [_^-1 * _]mulrC. by rewrite -ball_normE /= distrC subr0 (le_lt_trans leoxekx)// -ltr_pdivlMl //. Unshelve. all: by end_near. Qed. @@ -581,8 +595,10 @@ End DifferentialR3. Section DifferentialR3_numFieldType. Context {R : numFieldType}. +Generalizable Variables d. -Lemma littleo_linear0 (V W : normedModType R) (f : {linear V -> W}) : +Lemma littleo_linear0 `(V : normedModType d R) `(W : normedModType d' R) + (f : {linear V -> W}) : (f : V -> W) =o_ 0 id -> f = cst 0 :> (V -> W). Proof. move/eqoP => oid. @@ -590,8 +606,8 @@ rewrite funeqE => x; apply/eqP; have [|xn0] := real_le0P (normr_real x). by rewrite normr_le0 => /eqP ->; rewrite linear0. rewrite -normr_le0 -(mul0r `|x|) -ler_pdivrMr //. apply/ler_gtP => _ /posnumP[e]; rewrite ler_pdivrMr //. -have /oid /nbhs_ballP [_ /posnumP[d] dfe] := [elaborate gt0 e]. -set k := ((d%:num / 2) / (PosNum xn0)%:num)^-1. +have /oid /nbhs_ballP [_ /posnumP[e'] dfe] := [elaborate gt0 e]. +set k := ((e'%:num / 2) / (PosNum xn0)%:num)^-1. rewrite -{1}(@scalerKV _ _ k _ x) /k // linearZZ normrZ. rewrite -ler_pdivlMl; first by rewrite gtr0_norm. rewrite mulrCA (@le_trans _ _ (e%:num * `|k^-1 *: x|)) //; last first. @@ -601,8 +617,8 @@ rewrite invrK -ltr_pdivlMr // ger0_norm // ltr_pdivrMr //. by rewrite divfK ?lt0r_neq0// [ltRHS]splitr ltrDl. Qed. -Lemma diff_unique (V W : normedModType R) (f : V -> W) - (df : {linear V -> W}) x : +Lemma diff_unique `(V : normedModType d R) `(W : normedModType d' R) + (f : V -> W) (df : {linear V -> W}) x : continuous df -> f \o shift x = cst (f x) + df +o_ 0 id -> 'd f x = df :> (V -> W). Proof. @@ -629,12 +645,13 @@ rewrite [in LHS]littleo_center0 (comp_centerK x id). by rewrite -[- _ in RHS](comp_centerK x). Qed. -Lemma diff_cst (V W : normedModType R) a x : ('d (cst a) x : V -> W) = 0. +Lemma diff_cst `(V : normedModType d R) `(W : normedModType d' R) a x : + ('d (cst a) x : V -> W) = 0. Proof. by apply/diff_unique; have [] := dcst a x. Qed. -Variables (V W : normedModType R). +Context d d' (V : normedModType d R) (W : normedModType d' R). -Lemma differentiable_cst (W' : normedModType R) (a : W') (x : V) : +Lemma differentiable_cst `(W' : normedModType d'' R) (a : W') (x : V) : differentiable (cst a) x. Proof. by apply/diff_locallyP; rewrite diff_cst; have := dcst a x. Qed. @@ -724,7 +741,7 @@ move=> df; set g := RHS; have glin : linear g. by move=> a u v; rewrite /g linearP /= scalerDl -scalerA. pose glM := GRing.isLinear.Build _ _ _ _ _ glin. pose gL : {linear _ -> _} := HB.pack g glM. -by apply: (@diff_unique _ _ _ gL); have [] := dscalel f df. +by apply: (@diff_unique _ _ _ _ _ gL); have [] := dscalel f df. Qed. Lemma differentiableZl (k : V -> R) (f : W) x : @@ -733,12 +750,14 @@ Proof. by move=> df; apply/diff_locallyP; rewrite diffZl //; have [] := dscalel f df. Qed. -Lemma diff_lin (V' W' : normedModType R) (f : {linear V' -> W'}) x : +Lemma diff_lin `(V' : normedModType d0 R) `(W' : normedModType d1 R) + (f : {linear V' -> W'}) x : continuous f -> 'd f x = f :> (V' -> W'). Proof. by move=> fcont; apply/diff_unique => //; apply: dlin. Qed. -Lemma linear_differentiable (V' W' : normedModType R) (f : {linear V' -> W'}) - x : continuous f -> differentiable f x. +Lemma linear_differentiable d0 d0' (V' : normedModType d0 R) + (W' : normedModType d0' R) (f : {linear V' -> W'}) x : + continuous f -> differentiable f x. Proof. by move=> fcont; apply/diff_locallyP; rewrite diff_lin //; have := dlin x fcont. Qed. @@ -746,8 +765,8 @@ Qed. Global Instance is_diff_id (x : V) : is_diff x id id. Proof. apply: DiffDef. - by apply: (@linear_differentiable _ _ idfun) => ? //. -by rewrite (@diff_lin _ _ idfun) // => ? //. + by apply: (@linear_differentiable _ _ _ _ idfun) => ? //. +by rewrite (@diff_lin _ _ _ _ idfun) // => ? //. Qed. Global Instance is_diff_scaler (k : R) (x : V) : is_diff x ( *:%R k) ( *:%R k). @@ -777,7 +796,8 @@ have @f : {linear 'M[R]_(m, n) -> R}. rewrite (_ : (fun _ => _) = f) //; exact/linear_differentiable/coord_continuous. Qed. -Lemma linear_lipschitz (V' W' : normedModType R) (f : {linear V' -> W'}) : +Lemma linear_lipschitz `(V' : normedModType d0 R) `(W' : normedModType d1 R) + (f : {linear V' -> W'}) : continuous f -> exists2 k, k > 0 & forall x, `|f x| <= k * `|x|. Proof. move=> /(_ 0); rewrite /continuous_at linear0 => /(_ _ (nbhsx_ballx _ _ ltr01)). @@ -796,22 +816,26 @@ rewrite normfV ger0_norm /k // invfM/= divfK ?gt_eqF//. by rewrite invf_div gtr_pMr// invf_lt1// ltr1n. Qed. -Lemma linear_eqO (V' W' : normedModType R) (f : {linear V' -> W'}) : +Lemma linear_eqO `(V' : normedModType d0 R) `(W' : normedModType d1 R) + (f : {linear V' -> W'}) : continuous f -> (f : V' -> W') =O_ 0 id. Proof. move=> /linear_lipschitz [k kgt0 flip]; apply/eqO_exP; exists k => //. exact: filterE. Qed. -Lemma diff_eqO (V' W' : normedModType R) (x : filter_on V') (f : V' -> W') : +Lemma diff_eqO `(V' : normedModType d0 R) `(W' : normedModType d1 R) + (x : filter_on V') (f : V' -> W') : differentiable f x -> ('d f x : V' -> W') =O_ 0 id. Proof. by move=> /diff_continuous /linear_eqO; apply. Qed. -Lemma compOo_eqox (U V' W' : normedModType R) (f : U -> V') (g : V' -> W') x : +Lemma compOo_eqox `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : U -> V') (g : V' -> W') x : [O_ 0 id of g] ([o_ 0 id of f] x) =o_(x \near 0) x. Proof. by rewrite -[LHS]/((_ \o _) x) compOo_eqo. Qed. -Fact dcomp (U V' W' : normedModType R) (f : U -> V') (g : V' -> W') x : +Fact dcomp `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : U -> V') (g : V' -> W') x : differentiable f x -> differentiable g (f x) -> continuous ('d g (f x) \o 'd f x) /\ forall y, g (f (y + x)) = g (f x) + ('d g (f x) \o 'd f x) y +o_(y \near 0) y. @@ -823,22 +847,25 @@ rewrite diff_eqO // ['d f x : _ -> _]diff_eqO //. by rewrite {2}eqoO addOx compOo_eqox compoO_eqox addox. Qed. -Lemma diff_comp (U V' W' : normedModType R) (f : U -> V') (g : V' -> W') x : +Lemma diff_comp `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : U -> V') (g : V' -> W') x : differentiable f x -> differentiable g (f x) -> 'd (g \o f) x = 'd g (f x) \o 'd f x :> (U -> W'). Proof. by move=> df dg; apply/diff_unique; have [? /funext] := dcomp df dg. Qed. -Lemma differentiable_comp (U V' W' : normedModType R) (f : U -> V') - (g : V' -> W') x : differentiable f x -> differentiable g (f x) -> - differentiable (g \o f) x. +Lemma differentiable_comp `(U : normedModType d0 R) + `(V' : normedModType d1 R) `(W' : normedModType d2 R) + (f : U -> V') (g : V' -> W') x : + differentiable f x -> differentiable g (f x) -> differentiable (g \o f) x. Proof. move=> df dg; apply/diff_locallyP; rewrite diff_comp //; by have [? /funext]:= dcomp df dg. Qed. -Global Instance is_diff_comp (U V' W' : normedModType R) (f df : U -> V') - (g dg : V' -> W') x : is_diff x f df -> is_diff (f x) g dg -> - is_diff x (g \o f) (dg \o df) | 99. +Global Instance is_diff_comp `(U : normedModType d0 R) + `(V' : normedModType d1 R) `(W' : normedModType d2 R) + (f df : U -> V') (g dg : V' -> W') x : + is_diff x f df -> is_diff (f x) g dg -> is_diff x (g \o f) (dg \o df) | 99. Proof. move=> dfx dgfx; apply: DiffDef; first exact: differentiable_comp. by rewrite diff_comp // !diff_val. @@ -852,8 +879,9 @@ Lemma differentiable_lsubmx m {n1 n2} v : differentiable (lsubmx : 'M[R]_(m, n1 + n2) -> 'M[R]_(m, n1)) v. Proof. exact/linear_differentiable/continuous_lsubmx. Qed. -Lemma bilinear_schwarz (U V' W' : normedModType R) - (f : {bilinear U -> V' -> W'}) : continuous (fun p => f p.1 p.2) -> +Lemma bilinear_schwarz `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : {bilinear U -> V' -> W'}) : + continuous (fun p => f p.1 p.2) -> exists2 k, k > 0 & forall u v, `|f u v| <= k * `|u| * `|v|. Proof. move=> /(_ 0); rewrite /continuous_at linear0r => /(_ _ (nbhsx_ballx _ _ ltr01)). @@ -881,7 +909,8 @@ rewrite normrZ ger0_norm // -mulrA gtr_pMr // ltr_pdivrMl // mulr1. by rewrite prod_normE/= !normrZ !normfV !normr_id !mulVf ?gt_eqF// maxxx ltr1n. Qed. -Lemma bilinear_eqo (U V' W' : normedModType R) (f : {bilinear U -> V' -> W'}) : +Lemma bilinear_eqo `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2' R) (f : {bilinear U -> V' -> W'}) : continuous (fun p => f p.1 p.2) -> (fun p => f p.1 p.2) =o_ (0 : U * V') id. Proof. move=> fc; have [_ /posnumP[k] fschwarz] := bilinear_schwarz fc. @@ -894,14 +923,15 @@ near: x; apply/nbhs_le_nbhs_norm. by exists (k%:num ^-1 * e%:num) => //= ? /=; rewrite /= distrC subr0 => /ltW. Unshelve. all: by end_near. Qed. -Fact dbilin (U V' W' : normedModType R) (f : {bilinear U -> V' -> W'}) p : +Fact dbilin `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : {bilinear U -> V' -> W'}) p : continuous (fun p => f p.1 p.2) -> continuous (fun q => (f p.1 q.2 + f q.1 p.2)) /\ (fun q => f q.1 q.2) \o shift p = cst (f p.1 p.2) + (fun q => f p.1 q.2 + f q.1 p.2) +o_ (0 : U * V') id. Proof. move=> fc; split=> [q|]. - by apply: (@continuousD _ _ _ (fun q => f p.1 q.2) (fun q => f q.1 p.2)); + by apply: (@continuousD _ _ _ _ _ (fun q => f p.1 q.2) (fun q => f q.1 p.2)); move=> A /(fc (_.1, _.2)) /= /nbhs_ballP [_ /posnumP[e] fpqe_A]; apply/nbhs_ballP; exists e%:num => //= r [? ?]; exact: (fpqe_A (_.1, _.2)). apply/eqaddoE; rewrite funeqE => q /=. @@ -909,21 +939,22 @@ rewrite linearDr !linearDl -addrA addrC addrA [_ + f p.1 p.2]addrC. by congr (_ + _); rewrite -[LHS]/((fun p => f p.1 p.2) q) bilinear_eqo. Qed. -Lemma diff_bilin (U V' W' : normedModType R) (f : {bilinear U -> V' -> W'}) p : +Lemma diff_bilin `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : {bilinear U -> V' -> W'}) p : continuous (fun p => f p.1 p.2) -> 'd (fun q => f q.1 q.2) p = (fun q => f p.1 q.2 + f q.1 p.2) :> (U * V' -> W'). Proof. -pose d q := f p.1 q.2 + f q.1 p.2. -move=> fc; have lind : linear d. - by move=> ? ? ?; rewrite /d linearPr linearPl scalerDr addrACA. -pose dlM := GRing.isLinear.Build _ _ _ _ _ lind. -pose dL : {linear _ -> _} := HB.pack d dlM. -rewrite -/d -[d]/(dL : _ -> _). +pose s q := f p.1 q.2 + f q.1 p.2. +move=> fc; have lind : linear s. + by move=> ? ? ?; rewrite /s linearPr linearPl scalerDr addrACA. +pose slM := GRing.isLinear.Build _ _ _ _ _ lind. +pose sL : {linear _ -> _} := HB.pack s slM. +rewrite -/s -[s]/(sL : _ -> _). by apply/diff_unique; have [] := dbilin p fc. Qed. -Lemma differentiable_bilin (U V' W' : normedModType R) - (f : {bilinear U -> V' -> W'}) p : +Lemma differentiable_bilin `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : {bilinear U -> V' -> W'}) p : continuous (fun p => f p.1 p.2) -> differentiable (fun p => f p.1 p.2) p. Proof. by move=> fc; apply/diff_locallyP; rewrite diff_bilin //; apply: dbilin p fc. @@ -948,15 +979,16 @@ apply: DiffDef; last by rewrite diff_bilin // => ?; apply: mul_continuous. by apply: differentiable_bilin =>?; apply: mul_continuous. Qed. -Lemma eqo_pair (U V' W' : normedModType R) (F : filter_on U) - (f : U -> V') (g : U -> W') : +Lemma eqo_pair `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (F : filter_on U) (f : U -> V') (g : U -> W') : (fun t => ([o_F id of f] t, [o_F id of g] t)) =o_F id. Proof. apply/eqoP => _/posnumP[e]; near=> x; rewrite num_ge_max /=. by apply/andP; split; near: x; apply: littleoP. Unshelve. all: by end_near. Qed. -Fact dpair (U V' W' : normedModType R) (f : U -> V') (g : U -> W') x : +Fact dpair `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : U -> V') (g : U -> W') x : differentiable f x -> differentiable g x -> continuous (fun y => ('d f x y, 'd g x y)) /\ (fun y => (f y, g y)) \o shift x = cst (f x, g x) + @@ -973,29 +1005,33 @@ have -> : forall h e, (f x + 'd f x y + [o_ 0 id of h] y, by congr (_ + _); rewrite -[LHS]/((fun y => (_ y, _ y)) y) eqo_pair. Qed. -Lemma diff_pair (U V' W' : normedModType R) (f : U -> V') (g : U -> W') x : +Lemma diff_pair `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : U -> V') (g : U -> W') x : differentiable f x -> differentiable g x -> 'd (fun y => (f y, g y)) x = (fun y => ('d f x y, 'd g x y)) :> (U -> V' * W'). Proof. move=> df dg. -pose d y := ('d f x y, 'd g x y). -have lin_pair : linear d by move=> ???; rewrite /d !linearPZ. +pose p y := ('d f x y, 'd g x y). +have lin_pair : linear p by move=> ???; rewrite /p !linearPZ. pose pairlM := GRing.isLinear.Build _ _ _ _ _ lin_pair. -pose pairL : {linear _ -> _} := HB.pack d pairlM. -rewrite -/d -[d]/(pairL : _ -> _). +pose pairL : {linear _ -> _} := HB.pack p pairlM. +rewrite -/p -[p]/(pairL : _ -> _). by apply: diff_unique; have [] := dpair df dg. Qed. -Lemma differentiable_pair (U V' W' : normedModType R) (f : U -> V') +Lemma differentiable_pair `(U : normedModType d0 R) `(V' : normedModType d1 R) + `(W' : normedModType d2 R) (f : U -> V') (g : U -> W') x : differentiable f x -> differentiable g x -> differentiable (fun y => (f y, g y)) x. Proof. by move=> df dg; apply/diff_locallyP; rewrite diff_pair //; apply: dpair. Qed. -Global Instance is_diff_pair (U V' W' : normedModType R) (f df : U -> V') - (g dg : U -> W') x : is_diff x f df -> is_diff x g dg -> - is_diff x (fun y => (f y, g y)) (fun y => (df y, dg y)). +Global Instance is_diff_pair `(U : normedModType d0 R) + `(V' : normedModType d1 R) `(W' : normedModType d2 R) + (f df : U -> V') (g dg : U -> W') x : + is_diff x f df -> is_diff x g dg -> + is_diff x (fun y => (f y, g y)) (fun y => (df y, dg y)). Proof. move=> dfx dgx; apply: DiffDef; first exact: differentiable_pair. by rewrite diff_pair // !diff_val. @@ -1106,7 +1142,7 @@ Proof. by move=> /differentiableP df; rewrite diff_val. Qed. End DifferentialR3_numFieldType. Section DeriveRU. -Context {R : numFieldType} {U : normedModType R}. +Context {d} {R : numFieldType} {U : normedModType d R}. Implicit Types f : R -> U. Let der1 f x : derivable f x 1 -> @@ -1120,21 +1156,23 @@ Qed. Lemma deriv1E f x : derivable f x 1 -> 'd f x = ( *:%R^~ (f^`() x)) :> (R -> U). Proof. -pose d (h : R) := h *: (f^`() x)%classic. -move=> df; have lin_scal : linear d by move=> ? ? ?; rewrite /d scalerDl scalerA. +pose dh (h : R) := h *: (f^`() x)%classic. +move=> df; have lin_scal : linear dh by move=> ? ? ? + ; rewrite /dh scalerDl scalerA. pose scallM := GRing.isLinear.Build _ _ _ _ _ lin_scal. -pose scalL : {linear _ -> _} := HB.pack d scallM. -rewrite -/d -[d]/(scalL : _ -> _). +pose scalL : {linear _ -> _} := HB.pack dh scallM. +rewrite -/dh -[dh]/(scalL : _ -> _). by apply: diff_unique; [apply: scalel_continuous|apply: der1]. Qed. Lemma diff1E f x : differentiable f x -> 'd f x = (fun h => h *: f^`()%classic x) :> (R -> U). Proof. -pose d (h : R) := h *: 'd f x 1. -move=> df; have lin_scal : linear d by move=> ? ? ?; rewrite /d scalerDl scalerA. +pose dh (h : R) := h *: 'd f x 1. +move=> df; have lin_scal : linear dh by move=> ? ? ? + ; rewrite /dh scalerDl scalerA. pose scallM := GRing.isLinear.Build _ _ _ _ _ lin_scal. -pose scalL : {linear _ -> _} := HB.pack d scallM. +pose scalL : {linear _ -> _} := HB.pack dh scallM. have -> : (fun h => h *: f^`()%classic x) = scalL by rewrite derive1E'. apply: diff_unique; first exact: scalel_continuous. apply/eqaddoE; have /diff_locally -> := df; congr (_ + _ + _). @@ -1163,7 +1201,8 @@ Qed. End DeriveRU. Section DeriveVW. -Context {R : numFieldType} {V W : normedModType R}. +Context {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R}. Implicit Types f : V -> W. Lemma derivable1P f x v : @@ -1197,10 +1236,11 @@ Lemma is_derive_eq f (x v : V) (df f' : W) : Proof. by move=> ? <-. Qed. End DeriveVW. -Arguments derivable_cst {R V W}. +Arguments derivable_cst {d d' R V W}. Section Derive_lemmasVW. -Context {R : numFieldType} {V W : normedModType R}. +Context {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R}. Implicit Types f g : V -> W. Fact der_add f g (x v : V) : derivable f x v -> derivable g x v -> @@ -1325,7 +1365,7 @@ Proof. by rewrite derive_val. Qed. End Derive_lemmasVW. Section Derive_LR. -Context {R : numFieldType} {V : normedModType R}. +Context {d} {R : numFieldType} {V : normedModType d R}. Implicit Types (k : R -> R) (f : R -> V) (x : R). Lemma der1_scaleLR k f x : derivable k x 1 -> derivable f x 1 -> @@ -1367,7 +1407,7 @@ Proof. by move=> dk df; exact/ex_derive/is_derive1ZLR; apply: derivableP. Qed. End Derive_LR. Section derive_id. -Context {R : numFieldType} {V : normedModType R}. +Context {d} {R : numFieldType} {V : normedModType d R}. Lemma derivable_id (x v : V) : derivable id x v. Proof. exact/diff_derivable. Qed. @@ -1375,7 +1415,7 @@ Proof. exact/diff_derivable. Qed. Global Instance is_derive_id (x v : V) : is_derive x v id v. Proof. apply: (DeriveDef (@derivable_id _ _)). -rewrite deriveE// (@diff_lin _ _ _ idfun)//=. +rewrite deriveE// (@diff_lin _ _ _ _ _ idfun)//=. by rewrite /continuous_at. Qed. @@ -1394,7 +1434,7 @@ by apply/funext => x; rewrite derive1E deriveB// derive_id derive_cst sub0r. Qed. Section Derive_lemmasVR. -Context {R : numFieldType} {V : normedModType R}. +Context {d} {R : numFieldType} {V : normedModType d R}. Implicit Types (f g : V -> R) (x v : V). Fact der_mult f g x v : @@ -1411,7 +1451,7 @@ evar (fg : R -> R); rewrite [X in X @ _](_ : _ = fg) /=. rewrite scalerDr scalerA mulrC -scalerA. by rewrite [_ *: (g x *: _)]scalerA mulrC -scalerA /fg. apply: cvgD; last exact: cvgZl_tmp df. -apply: cvg_comp2 (@scale_continuous _ _ (_, _)) => /=; last exact: dg. +apply: cvg_comp2 (@scale_continuous _ _ _ (_, _)) => /=; last exact: dg. suff : {for 0, continuous (fun h : R => f(h *: v + x))}. by move=> /continuous_withinNx; rewrite scale0r add0r. exact/differentiable_continuous/derivable1_diffP/(derivable1P _ _ _).1. @@ -1518,7 +1558,7 @@ End Derive_lemmasVR. #[global] Hint Extern 0 (is_derive _ _ (fun _ => (_ _)^-1) _) => (apply: is_deriveV; first by []) : typeclass_instances. -Lemma derive_shift {R : numFieldType} {V : normedModType R} (v k : V) : +Lemma derive_shift {d} {R : numFieldType} {V : normedModType d R} (v k : V) : 'D_v (shift k : V -> V) = cst v. Proof. by apply/funext => x/=; rewrite deriveD// derive_id derive_cst addr0. @@ -1527,12 +1567,13 @@ Qed. Lemma derive1_shift {R : numFieldType} (k : R) : (shift k)^`() = cst 1. Proof. by rewrite -(derive_shift _ k); apply/funext => x; rewrite derive1E. Qed. -Lemma is_derive_shift {R : numFieldType} {V : normedModType R} x (v k : V) : +Lemma is_derive_shift {d} {R : numFieldType} {V : normedModType d R} + x (v k : V) : is_derive x v (shift k) v. Proof. by apply: DeriveDef => //; rewrite derive_val addr0. Qed. Section derive_comp_shift. -Context {R : numFieldType} {V : normedModType R} (f : R -> V). +Context {d} {R : numFieldType} {V : normedModType d R} (f : R -> V). Implicit Types x a v : R. Lemma derive_comp_shift x a v : 'D_v (f \o shift a) x = 'D_v f (x + a). @@ -1553,7 +1594,7 @@ Qed. End derive_comp_shift. -Lemma derive1_cst {R : numFieldType} (V : normedModType R) (k : V) t : +Lemma derive1_cst {d} {R : numFieldType} (V : normedModType d R) (k : V) t : (cst k)^`() t = 0. Proof. by rewrite derive1E derive_cst. Qed. @@ -1579,7 +1620,7 @@ Qed. Lemma exp_derive {R : numFieldType} n x v : 'D_v (@GRing.exp R ^~ n) x = n%:R *: x ^+ n.-1 *: v. Proof. -have /= := @deriveX R R id n x v (@derivable_id _ _ _ _). +have /= := @deriveX _ R R id n x v (@derivable_id _ _ _ _ _). by rewrite fctE => ->; rewrite derive_id. Qed. @@ -1591,7 +1632,7 @@ Lemma exp_derive1 {R : numFieldType} n x : (@GRing.exp R ^~ n)^`() x = n%:R *: x ^+ n.-1. Proof. by rewrite derive1E exp_derive [LHS]mulr1. Qed. -Lemma compact_EVT_max (T : topologicalType) (R : realType) (f : T -> R) +Lemma compact_EVT_max d (T : topologicalType d) (R : realType) (f : T -> R) (A : set T) : A !=set0 -> compact A -> {within A, continuous f} -> exists2 c, c \in A & forall t, t \in A -> f t <= f c. @@ -1622,7 +1663,7 @@ rewrite invf_plt ?posrE ?subr_gt0 ?AfsupfA//; first exact/mem_set. by rewrite (le_lt_trans (ler_norm _))// imVfltk//; exact: imageP. Qed. -Lemma compact_EVT_min (T : topologicalType) (R : realType) (f : T -> R) +Lemma compact_EVT_min d (T : topologicalType d) (R : realType) (f : T -> R) (A : set T) : A !=set0 -> compact A -> {within A, continuous f} -> exists2 c, c \in A & forall t, t \in A -> f c <= f t. @@ -1663,23 +1704,24 @@ Lemma EVT_min_rV (R : realType) n (f : 'rV[R]_n -> R) (A : set 'rV[R]_n) : exists2 c, c \in A & forall t, t \in A -> f c <= f t. Proof. by move=> A0 cA cf; exact: compact_EVT_min. Qed. -Lemma cvg_at_rightE (R : numFieldType) (V : normedModType R) (f : R -> V) x : +Lemma cvg_at_rightE d (R : numFieldType) (V : normedModType d R) + (f : R -> V) x : cvg (f @ x^') -> lim (f @ x^') = lim (f @ at_right x). Proof. move=> cvfx; apply/esym/norm_cvg_lim. move=> A /cvfx /nbhs_ballP [_ /posnumP[e] xe_A]. by exists e%:num => //= y xe_y /gt_eqF/negbT/xe_A; exact. Qed. -Arguments cvg_at_rightE {R V} f x. +Arguments cvg_at_rightE {d R V} f x. -Lemma cvg_at_leftE (R : numFieldType) (V : normedModType R) (f : R -> V) x : +Lemma cvg_at_leftE d (R : numFieldType) (V : normedModType d R) (f : R -> V) x : cvg (f @ x^') -> lim (f @ x^') = lim (f @ at_left x). Proof. move=> cvfx; apply/esym/norm_cvg_lim. move=> A /cvfx /nbhs_ballP [_ /posnumP[e] xe_A]. by exists e%:num => //= y xe_y /lt_eqF/negbT/xe_A; exact. Qed. -Arguments cvg_at_leftE {R V} f x. +Arguments cvg_at_leftE {d R V} f x. Lemma derive1_at_max (R : realFieldType) (f : R -> R) (a b c : R) : a <= b -> (forall t, t \in `]a, b[%R -> derivable f t 1) -> c \in `]a, b[%R -> @@ -2169,23 +2211,25 @@ Qed. Global Instance is_derive1_comp {R : numFieldType} (f g : R -> R) (x a b : R) : is_derive (g x) 1 f a -> is_derive x 1 g b -> is_derive x 1 (f \o g) (a * b). Proof. -move=> [fgxv <-{a}] [gv <-{b}]; apply: (@DeriveDef _ _ _ _ _ (f \o g)). +move=> [fgxv <-{a}] [gv <-{b}]; apply: (@DeriveDef _ _ _ _ _ _ _ (f \o g)). apply/derivable1_diffP/differentiable_comp; first exact/derivable1_diffP. by move/derivable1_diffP in fgxv. by rewrite -derive1E (derive1_comp gv fgxv) 2!derive1E. Qed. -Lemma near_eq_growth_rate {R : numFieldType} {V W : normedModType R} +Lemma near_eq_growth_rate {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R} (f g : V -> W) (a v : V) : {near a, f =1 g} -> \forall h \near 0, h^-1 *: (f (h *: v + a) - f a) = h^-1 *: (g (h *: v + a) - g a). Proof. move=> fg; near do rewrite (nbhs_singleton fg) (near fg)// addrC. -apply/(@near0Z _ _ _ [set v | (a + v) \is_near (nbhs a)])=> /=. +apply/(@near0Z _ _ _ _ [set v | (a + v) \is_near (nbhs a)])=> /=. by rewrite (near_shift a)/=; near do rewrite /= sub0r addrC addrNK//. Unshelve. all: by end_near. Qed. -Lemma near_eq_derivable {R : numFieldType} {V W : normedModType R} +Lemma near_eq_derivable {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R} (f g : V -> W) (a v : V) : {near a, f =1 g} -> derivable f a v -> derivable g a v. Proof. @@ -2194,7 +2238,8 @@ move=> vn0 nfg /cvg_ex[/= l fl]; apply/cvg_ex; exists l => /=. exact/(cvg_trans _ fl)/near_eq_cvg/cvg_within/near_eq_growth_rate. Qed. -Lemma near_eq_derive {R : numFieldType} {V W : normedModType R} +Lemma near_eq_derive {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R} (f g : V -> W) (a v : V) : (\forall a0 \near a, f a0 = g a0) -> 'D_v f a = 'D_v g a. Proof. @@ -2204,7 +2249,8 @@ rewrite eqEsubset; split; apply/near_eq_cvg/cvg_within/near_eq_growth_rate =>//. by near do apply/esym. Unshelve. all: by end_near. Qed. -Lemma near_eq_is_derive {R : numFieldType} {V W : normedModType R} +Lemma near_eq_is_derive {d d'} {R : numFieldType} + {V : normedModType d R} {W : normedModType d' R} (f g : V -> W) (a v : V) (df : W) : (\forall a0 \near a, f a0 = g a0) -> is_derive a v f df -> is_derive a v g df. Proof. @@ -2213,7 +2259,7 @@ by apply: DeriveDef => //; exact: near_eq_derivable fav. Qed. Section near_eq_derive1. -Context {R : numFieldType} {V : normedModType R}. +Context {d} {R : numFieldType} {V : normedModType d R}. Implicit Types (f g : R -> V) (x : R). Lemma near_eq_derive1n_near n f g x: @@ -2221,7 +2267,7 @@ Lemma near_eq_derive1n_near n f g x: Proof. move=> fg; elim: n => [//|n IH]. near do (rewrite 2!derive1nS !derive1E; apply: near_eq_derive). -exact: (@near_join _ x). +exact: (@near_join _ _ x). Unshelve. all: by end_near. Qed. Lemma near_eq_derive1_near f g x : {near x, f =1 g} -> {near x, f^`() =1 g^`()}. @@ -2236,7 +2282,8 @@ Proof. by rewrite -!derive1n1; exact: near_eq_derive1n. Qed. End near_eq_derive1. Section Derive_max. -Context {K : realType} {V W : normedModType K}. +Context {d d'} {K : realType} + {V : normedModType d K} {W : normedModType d' K}. Implicit Types f g : V -> K^o. Implicit Type x : V. @@ -2389,7 +2436,7 @@ Qed. End derive_horner. Section pointwise_derivable. -Context {R : realFieldType} {V : normedModType R} {m n : nat}. +Context {d} {R : realFieldType} {V : normedModType d R} {m n : nat}. Implicit Types M : V -> 'M[R]_(m, n). Lemma derivable_mxP M t v : @@ -2421,14 +2468,15 @@ End pointwise_derivable. Section pointwise_derive. Local Open Scope classical_set_scope. -Context {R : realFieldType} {V : normedModType R}. +Context {d} {R : realFieldType} {V : normedModType d R}. Lemma derive_mx {m n : nat} (M : V -> 'M[R]_(m, n)) t v : derivable M t v -> 'D_v M t = \matrix_(i < m, j < n) 'D_v (fun t => M t i j) t. Proof. move=> /cvg_ex[/= l Mvtl]; apply/cvg_lim => //=; apply/cvgrPdist_le => /= e e0. -move/cvgrPdist_le : (Mvtl) => /(_ (e / 2)) /[!divr_gt0]// /(_ isT)[d /= d0 dle]. +move/cvgrPdist_le : (Mvtl) => /(_ (e / 2)) /[!divr_gt0]//. +move=> /(_ isT)[e' /= e0' dle]. near=> x. rewrite [leLHS]/Num.Def.normr/= mx_normrE (bigmax_le _ (ltW e0))//= => -[i j] _. rewrite [in leLHS]mxE/= [X in _ + X]mxE -(subrKA (l i j)). @@ -2479,7 +2527,7 @@ apply/cvgrPdist_le => /= e e0. move/cvgrPdist_le : Ml => /(_ _ e0)[/= r r0 re]. near=> x. rewrite [leLHS](_ : _ = `|l - x^-1 *: (M (x *: v + t) - M t)|). - rewrite -[RHS]norm_trmx [in RHS]linearD/= [in RHS]linearN/=. + rewrite -[RHS]norm_trmx [in RHS]linearD/= [in RHS]linearN. by congr (`| _ - _ |); rewrite [RHS]linearZ/= [in RHS]linearB. apply: re => /=; last by near: x. by rewrite sub0r normrN; near: x; exact: dnbhs0_lt. @@ -2531,7 +2579,7 @@ have glin : linear (g : V -> _). by rewrite /g linearD linearZ/=; apply/matrixP => i j; rewrite !mxE. pose glM := GRing.isLinear.Build _ _ _ _ _ glin. pose gL : {linear _ -> _} := HB.pack g glM. -by apply: (@diff_unique _ _ _ _ gL); have [? ?] := dmx dM. +by apply: (@diff_unique _ _ _ _ _ _ gL); have [? ?] := dmx dM. Qed. Global Instance is_derive_mx_coord n m @@ -2573,7 +2621,7 @@ Proof. move=> /= MdM. have diffMx : differentiable M (nbhs_filter_on x). apply/derivable1_diffP; apply/derivable_mxP => i j. - by have [/(@derivable1_diffP _ _ (fun t => M t i j) x)] := MdM i j. + by have [/(@derivable1_diffP _ _ _ (fun t => M t i j) x)] := MdM i j. apply: DiffDef; first exact: diffMx. rewrite diffmx//=; apply/funext => /= v; apply/matrixP => i j. rewrite !mxE. @@ -2589,7 +2637,7 @@ Qed. End Ris_diff_mx. Section derivable_derive_row_mx. -Context {R : realFieldType} {V : normedModType R} {n1 n2 : nat}. +Context {d} {R : realFieldType} {V : normedModType d R} {n1 n2 : nat}. Implicit Types (f : V -> 'rV[R]_n1) (g : V -> 'rV[R]_n2). Lemma derivable_row_mx f g t v : derivable f t v -> derivable g t v -> diff --git a/theories/ereal.v b/theories/ereal.v index 2988cf8398..082bb7a4ca 100644 --- a/theories/ereal.v +++ b/theories/ereal.v @@ -885,7 +885,7 @@ Definition ereal_nbhs (x : \bar R) : set_system (\bar R) := | +oo => exists M, M \is Num.real /\ forall y, M%:E < y -> P y | -oo => exists M, M \is Num.real /\ forall y, y < M%:E -> P y end]. -HB.instance Definition _ := hasNbhs.Build (\bar R) ereal_nbhs. +HB.instance Definition _ := hasNbhs.Build default_fdisp (\bar R) ereal_nbhs. End ereal_nbhs. Section ereal_nbhs_instances. @@ -1021,7 +1021,7 @@ move: p => -[p| [M [Mreal MA]] | [M [Mreal MA]]] //=. - move=> /nbhs_ballP[_/posnumP[e]] ballA. apply/nbhs_ballP; exists (e%:num / 2)%R => //= r per. apply/nbhs_ballP; exists (e%:num / 2)%R => //= x rex. - apply/ballA/(@ball_splitl _ _ r) => //; exact/ball_sym. + apply/ballA/(@ball_splitl _ _ _ r) => //; exact/ball_sym. - exists (M + 1)%R; split; first by rewrite realD. move=> -[x| _ |_] //=; last by exists M. rewrite lte_fin => M'x /=. @@ -1567,7 +1567,7 @@ rewrite predeq2E => x A; split. * by move/nbhs_oo_down_1e; apply => x ex; exact/sEA/xsectionP/reA. Qed. -HB.instance Definition _ := Nbhs_isPseudoMetric.Build R (\bar R) +HB.instance Definition _ := Nbhs_isPseudoMetric.Build _ R (\bar R) ereal_nbhsE ereal_ball_center ereal_ball_sym ereal_ball_triangle erefl. End ereal_PseudoMetric. @@ -1642,10 +1642,10 @@ Context {R : numFieldType} {F : set_system \bar R} {FF : Filter F}. Lemma fine_fcvg a : F --> a%:E -> fine @ F --> a. Proof. move=> /(_ _)/= Fa. -apply/(@metricType_numDomainType.cvgrPdist_lt _ R^o) => // _/posnumP[e]. +apply/(@metricType_numDomainType.cvgrPdist_lt _ _ R^o) => // _/posnumP[e]. rewrite near_simpl. apply: Fa; apply/nbhs_EFin. -exact: (@metricType_numDomainType.cvgr_dist_lt _ _ _ (nbhs a)). +exact: (@metricType_numDomainType.cvgr_dist_lt _ _ _ _ (nbhs a)). Qed. End filter. diff --git a/theories/esum.v b/theories/esum.v index 2e99454fca..5c09b06718 100644 --- a/theories/esum.v +++ b/theories/esum.v @@ -1048,7 +1048,7 @@ suff: ((fun n => C_ n - (A - B)) @ \oo --> (0 : R^o))%R. rewrite [X in X - _]esummable_nneseries_lim//; first exact/esummable_funepos. rewrite [X in _ - X]esummable_nneseries_lim//; first exact/esummable_funeneg. rewrite -EFinB; apply/cvg_lim => //; apply/fine_cvgP; split; last first. - exact: (@cvg_sub0 _ _ _ _ _ (cst (A - B)%R)). + exact: (@cvg_sub0 _ _ _ _ _ _ (cst (A - B)%R)). apply: nearW => n; rewrite fin_num_abs; apply: le_lt_trans Pf => /=. by rewrite -nneseries_esum// (le_trans (lee_abs_sum _ _ _))// nneseries_lim_ge. have : ((fun x => A_ x - B_ x) @ \oo --> A - B)%R. diff --git a/theories/exp.v b/theories/exp.v index bb4aca72ea..725412182a 100644 --- a/theories/exp.v +++ b/theories/exp.v @@ -331,7 +331,7 @@ have F m : (n.+1 < m)%N -> exact: ltn_trans ni. by rewrite /f/= add0r mulr0n addr0 eqxx 2!mulr1n. rewrite [leLHS](_ : _ = limn (series (f n.+1 x))). - by apply/esym/(@lim_near_cst R^o) => //; near=> k; apply: F; near: k. + by apply/esym/(@lim_near_cst _ R^o) => //; near=> k; apply: F; near: k. apply: ler_lim; first by apply: is_cvg_near_cst; near=> k; apply: F; near: k. exact: is_cvg_series_exp_coeff. near=> k; apply: ler_sum => -[|[|i]] _; rewrite /f /exp_coeff/= ?add0r. @@ -1092,7 +1092,7 @@ Lemma derivable_powR v x : {in `]0, +oo[, forall a, derivable (powR ^~ x) a v}. Proof. have [-> y _|] := eqVneq v 0; first exact/derivable0. move=> v0 a; rewrite in_itv/= andbT => a0. -apply: (@near_eq_derivable _ _ _ (fun a' => expR (x * ln a'))) => //. +apply: (@near_eq_derivable _ _ _ _ _ (fun a' => expR (x * ln a'))) => //. by near=> b; rewrite /powR gt_eqF//; near: b; exact: lt_nbhsr. apply: diff_derivable; apply: differentiable_comp; last exact/derivable1_diffP. apply: differentiableM => //; apply/derivable1_diffP. @@ -1104,7 +1104,7 @@ Lemma powR_derive1 a : {in `]0, +oo[%R, Proof. move=> x; rewrite in_itv/= andbT => x0. rewrite derive1E. -rewrite (@near_eq_derive _ _ _ _ (fun x => expR (a * ln x)))//. +rewrite (@near_eq_derive _ _ _ _ _ _ (fun x => expR (a * ln x)))//. by near=> z; rewrite /powR gt_eqF//; near: z; exact: lt_nbhsr. rewrite -derive1E. rewrite derive1_comp//=. diff --git a/theories/ftc.v b/theories/ftc.v index 1a87caf329..c26718387d 100644 --- a/theories/ftc.v +++ b/theories/ftc.v @@ -591,7 +591,7 @@ have GacFa : G x @[x --> a^'+] --> (- c + F a)%R. apply/cvgrPdist_le => /= e e0; near=> t. rewrite opprB GFc; first by rewrite in_itv/=; apply/andP. by rewrite addNr normr0 ltW. - have := @cvgD _ _ _ Fap _ _ _ _ GFac Fa. + have := @cvgD _ _ _ _ Fap _ _ _ _ GFac Fa. rewrite (_ : (G \- F) + F = G)%R//. by apply/funext => x/=; rewrite subrK. have GbcFb : G x @[x --> b^'-] --> (- c + F b)%R. @@ -600,7 +600,7 @@ have GbcFb : G x @[x --> b^'-] --> (- c + F b)%R. apply/cvgrPdist_le => /= e e0; near=> t. rewrite opprB GFc; first by rewrite in_itv/=; apply/andP. by rewrite addNr normr0 ltW. - have := @cvgD _ _ _ Fbn _ _ _ _ GFbc Fb. + have := @cvgD _ _ _ _ Fbn _ _ _ _ GFbc Fb. rewrite (_ : G \- F + F = G)%R //. by apply/funext => x/=; rewrite subrK. have contF : {within `[a, b], continuous F}. @@ -1372,7 +1372,7 @@ have DPGFE : {in `]a, b[, (- (PG \o F))%R^`() =1 ((G \o F) * (- f))%R}. apply: diff_derivable; apply: differentiable_comp; apply/derivable1_diffP. by case: Fab => + _ _; exact. by case: PGFbFa => + _ _; apply; exact: decreasing_image_oo. - have /(@derive_val _ _ _ _ _ -%R) := @is_deriveNid _ _ (PG (F x)) 1%R. + have /(@derive_val _ _ _ _ _ _ _ -%R) := @is_deriveNid _ _ _ (PG (F x)) 1%R. rewrite fctE -derive1E => ->; rewrite mulN1r mulrN; congr -%R. rewrite derive1_comp. - by case: Fab => + _ _; exact. @@ -1393,7 +1393,7 @@ rewrite oppeD//= -(continuous_FTC2 ab _ _ DPGFE). * have : -%R F^`() @ x --> (- f x)%R. by rewrite -fE//; apply: cvgN; exact: cF'. apply: cvg_trans; apply: near_eq_cvg. - apply: (@open_in_nearW _ _ `]a, b[) ; last by rewrite inE. + apply: (@open_in_nearW _ _ _ `]a, b[) ; last by rewrite inE. exact: interval_open. by move=> z; rewrite inE/= => zab; rewrite fctE fE. + apply: cvgM. @@ -1743,7 +1743,7 @@ rewrite (@decreasing_ge0_integration_by_substitutiony (- F)%R). rewrite derive1E deriveN -?derive1E//. apply: dF. near: z. - apply: (@open_in_nearW _ _ `]a, +oo[). + apply: (@open_in_nearW _ _ _ `]a, +oo[). + exact: interval_open. + by move=> ?; rewrite inE. + by rewrite inE. @@ -1845,7 +1845,7 @@ rewrite (@increasing_ge0_integration_by_substitutiony (\- (F \o -%R))%R). rewrite [X in (_ * X)%R]derive1E. rewrite deriveN; first exact: derivable_id. by rewrite derive_id mulrN1 opprK. - move/(@cvg_compNP _ _ (F^`()) x (F^`() (- x))) : NxF. + move/(@cvg_compNP _ _ _ (F^`()) x (F^`() (- x))) : NxF. apply: cvg_trans. apply: near_eq_cvg; rewrite near_simpl; near=> z. rewrite derive1N. diff --git a/theories/functional_analysis/hahn_banach_theorem.v b/theories/functional_analysis/hahn_banach_theorem.v index 378d8e7bc3..7ad81a310d 100644 --- a/theories/functional_analysis/hahn_banach_theorem.v +++ b/theories/functional_analysis/hahn_banach_theorem.v @@ -325,8 +325,8 @@ Qed. End hahn_banach. Section hahn_banach_normed. -Variable (R : realType) (V : normedModType R) (F : pred V) - (F' : subNormedModType F) (f : {linear_continuous F' -> R}). +Context d d' (R : realType) (V : normedModType d R) (F : pred V) + (F' : subNormedModType d' F) (f : {linear_continuous F' -> R}). Theorem hahn_banach_extension_normed : exists g : {linear_continuous V -> R}, forall x : F', g (val x) = f x. @@ -360,7 +360,7 @@ have contg : continuous (g : V -> R). - rewrite lerNl -linearN (le_trans (majgp (- y)))//. by rewrite /p -(mul1r M) ltW// ltr_pM// ltW. - by rewrite (le_trans (majgp y))// /p -(mul1r M) -normrN ltW// ltr_pM// ltW. -pose lcg := isLinearContinuous.Build _ _ _ _ g ling contg. +pose lcg := isLinearContinuous.Build _ _ _ _ _ _ g ling contg. pose g' : {linear_continuous V -> R | *%R} := HB.pack (g : V -> R) lcg. by exists g'. Qed. @@ -368,7 +368,7 @@ Qed. End hahn_banach_normed. Section hahn_banach_extension_ctvs. -Context {R : realType} {V : convexTvsType R} (F : pred V). +Context {d} {R : realType} {V : convexTvsType d R} (F : pred V). (**md Contrary to the normed case, the extension theorem is not true for any subtopology on `F`, but only for the finest one. *) @@ -380,7 +380,7 @@ Let $V$ be a real vector space, $F$ a subspace of $V$, and $p \in V^{\#}$ (the set of all sublinear functionals on $V$) and $p$ is a seminorm, if $f \in F^*$ satisfies $|f| \leq p|_F$, then a $g\in V^*$ exists such that $g|_F = f$. *) -Theorem hahn_banach_extension_subctvs (F' : subConvexTvsType F) +Theorem hahn_banach_extension_subctvs d' (F' : subConvexTvsType d' F) (f : {linear F' -> R}) : (exists2 p : SemiNorm.type V, seminorm_of p & forall z : F', f z <= p (val z)) -> @@ -396,7 +396,7 @@ have [g majgp F_eqgf] := @hahn_banach_extension R V _ F' f p convp fp. have ling : linear (g : V -> R) by exact: linearP. have contg : continuous (g : V -> R). by apply/lcfun_seminorm; exists p => //; exact: continuous_seminorm_of. -pose lcg := isLinearContinuous.Build _ _ _ _ g ling contg. +pose lcg := isLinearContinuous.Build _ _ _ _ _ _ g ling contg. pose g' : {linear_continuous V -> R | *%R} := HB.pack (g : V -> R) lcg. by exists g'. Qed. @@ -451,7 +451,7 @@ have [g majgp F_eqgf] := @hahn_banach_extension R V _ F' f p' convp fp'. have ling : linear (g : V -> R) by exact: linearP. have contg : continuous (g : V -> R). by apply/lcfun_seminorm; exists p' => //; exact: continuous_seminorm_of. -pose lcg := isLinearContinuous.Build _ _ _ _ g ling contg. +pose lcg := isLinearContinuous.Build _ _ _ _ _ _ g ling contg. pose g' : {linear_continuous V -> R | *%R} := HB.pack (g : V -> R) lcg. by exists g'. Qed. diff --git a/theories/gauss_integral.v b/theories/gauss_integral.v index a0c9a5bdaf..8074c2d138 100644 --- a/theories/gauss_integral.v +++ b/theories/gauss_integral.v @@ -46,7 +46,7 @@ Proof. by apply: measurableT_comp => //; exact: measurableT_comp. Qed. Lemma continuous_gauss_fun : continuous gauss_fun. Proof. -move=> x; apply: (@continuous_comp _ _ _ (fun x : R => - x ^+ 2) expR). +move=> x; apply: (@continuous_comp _ _ _ _ _ _ (fun x : R => - x ^+ 2) expR). by apply: cvgN; exact: exprn_continuous. exact: continuous_expR. Qed. @@ -120,7 +120,7 @@ Qed. Let continuous_gaussM x : continuous (fun r : R => gauss_fun (r * x)). Proof. move=> x0. -apply: (@continuous_comp _ _ _ (fun r : R => - (r * x) ^+ 2) expR). +apply: (@continuous_comp _ _ _ _ _ _ (fun r : R => - (r * x) ^+ 2) expR). exact: continuous_NsqrM. exact: continuous_expR. Qed. @@ -229,7 +229,7 @@ Proof. move=> x0. rewrite /h derive1E deriveD//=. apply/diff_derivable. - apply: (@differentiable_comp _ _ _ _ integral0_gauss (fun x => x ^+ 2)). + apply: (@differentiable_comp _ _ _ _ _ _ _ integral0_gauss (fun x => x ^+ 2)). apply/derivable1_diffP. by have [] := derive_integral0_gauss x0. by apply/derivable1_diffP; exact: exprn_derivable. diff --git a/theories/homotopy_theory/continuous_path.v b/theories/homotopy_theory/continuous_path.v index 6ed100fde3..2a5ae6005c 100644 --- a/theories/homotopy_theory/continuous_path.v +++ b/theories/homotopy_theory/continuous_path.v @@ -39,31 +39,33 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Local Open Scope quotient_scope. -HB.mixin Record isPath {i : bpTopologicalType} {T : topologicalType} (x y : T) - (f : i -> T) & isContinuous i T f := { +HB.mixin Record isPath {d d'} {i : bpTopologicalType d} + {T : topologicalType d'} (x y : T) (f : i -> T) + & isContinuous d d' i T f := { path_zero : f zero = x; path_one : f one = y; }. #[short(type="pathType")] -HB.structure Definition Path {i : bpTopologicalType} {T : topologicalType} - (x y : T) := {f of isPath i T x y f & isContinuous i T f}. +HB.structure Definition Path {d d'} {i : bpTopologicalType d} + {T : topologicalType d'} (x y : T) := + {f of isPath d d' i T x y f & isContinuous d d' i T f}. Notation "{ 'path' i 'from' x 'to' y }" := (pathType i x y) : type_scope. Notation "{ 'path' i 'from' x 'to' y 'in' T }" := - (@pathType i T x y) : type_scope. - -HB.instance Definition _ {i : bpTopologicalType} - {T : topologicalType} (x y : T) := gen_eqMixin {path i from x to y}. -HB.instance Definition _ {i : bpTopologicalType} - {T : topologicalType} (x y : T) := gen_choiceMixin {path i from x to y}. -HB.instance Definition _ {i : bpTopologicalType} - {T : topologicalType} (x y : T) := + (@pathType _ _ i T x y) : type_scope. + +HB.instance Definition _ {d d'} {i : bpTopologicalType d} + {T : topologicalType d'} (x y : T) := gen_eqMixin {path i from x to y}. +HB.instance Definition _ {d d'} {i : bpTopologicalType d} + {T : topologicalType d'} (x y : T) := gen_choiceMixin {path i from x to y}. +HB.instance Definition _ {d d'} {i : bpTopologicalType d} + {T : topologicalType d'} (x y : T) := Topological.copy {path i from x to y} (@initial_topology {path i from x to y} {compact-open, i -> T} id). Section path_eq. -Context {T : topologicalType} {i : bpTopologicalType} (x y : T). +Context {d d'} {T : topologicalType d} {i : bpTopologicalType d'} (x y : T). Lemma path_eqP (a b : {path i from x to y}) : a = b <-> a =1 b. Proof. @@ -77,18 +79,19 @@ Qed. End path_eq. Section cst_path. -Context {T : topologicalType} {i : bpTopologicalType} (x: T). +Context {d d'} {T : topologicalType d} {i : bpTopologicalType d'} (x: T). -HB.instance Definition _ := @isPath.Build i T x x (cst x) erefl erefl. +HB.instance Definition _ := @isPath.Build _ _ i T x x (cst x) erefl erefl. End cst_path. Section path_domain_path. -Context {i : bpTopologicalType}. -HB.instance Definition _ := @isPath.Build i i zero one idfun erefl erefl. +Context {d} {i : bpTopologicalType d}. +HB.instance Definition _ := @isPath.Build _ _ i i zero one idfun erefl erefl. End path_domain_path. Section path_compose. -Context {T U : topologicalType} (i: bpTopologicalType) (x y : T). +Context {d d' d''} {T : topologicalType d} {U : topologicalType d'} + (i: bpTopologicalType d'') (x y : T). Context (f : continuousType T U) (p : {path i from x to y}). Local Lemma fp_zero : (f \o p) zero = f x. @@ -97,13 +100,14 @@ Proof. by rewrite /= !path_zero. Qed. Local Lemma fp_one : (f \o p) one = f y. Proof. by rewrite /= !path_one. Qed. -HB.instance Definition _ := isPath.Build i U (f x) (f y) (f \o p) +HB.instance Definition _ := isPath.Build _ _ i U (f x) (f y) (f \o p) fp_zero fp_one. End path_compose. Section path_reparameterize. -Context {T : topologicalType} (i j: bpTopologicalType) (x y : T). +Context {d d' d''} {T : topologicalType d} + (i : bpTopologicalType d') (j: bpTopologicalType d'') (x y : T). Context (f : {path i from x to y}) (phi : {path j from zero to one in i}). (* we use reparameterize, as opposed to just `\o` because we can simplify the @@ -121,30 +125,31 @@ Proof. by rewrite /reparameterize /= ?path_one. Qed. Let fphi_cts : continuous reparameterize. Proof. by move=> ?; apply: continuous_comp; exact: continuous_fun. Qed. -HB.instance Definition _ := isContinuous.Build _ _ reparameterize fphi_cts. +HB.instance Definition _ := isContinuous.Build _ _ _ _ reparameterize fphi_cts. -HB.instance Definition _ := isPath.Build j T x y reparameterize +HB.instance Definition _ := isPath.Build _ _ j T x y reparameterize fphi_zero fphi_one. End path_reparameterize. Section mk_path. -Context {i : bpTopologicalType} {T : topologicalType}. +Context {d d'} {i : bpTopologicalType d} {T : topologicalType d'}. Context {x y : T} (f : i -> T) (ctsf : continuous f). Context (f0 : f zero = x) (f1 : f one = y). Definition mk_path : i -> T := let _ := (ctsf, f0, f1) in f. -HB.instance Definition _ := isContinuous.Build i T mk_path ctsf. -HB.instance Definition _ := @isPath.Build i T x y mk_path f0 f1. +HB.instance Definition _ := isContinuous.Build _ _ i T mk_path ctsf. +HB.instance Definition _ := @isPath.Build _ _ i T x y mk_path f0 f1. End mk_path. -Definition chain_path {i j : bpTopologicalType} {T : topologicalType} - (f : i -> T) (g : j -> T) : bpwedge i j -> T := + +Definition chain_path {d d'} {i j : bpTopologicalType d} + {T : topologicalType d'} (f : i -> T) (g : j -> T) : bpwedge i j -> T := wedge_fun (fun b => if b return (if b then i else j) -> T then f else g). -Lemma chain_path_cts_point {i j : bpTopologicalType} {T : topologicalType} - (f : i -> T) (g : j -> T) : +Lemma chain_path_cts_point {d d'} {i j : bpTopologicalType d} + {T : topologicalType d'} (f : i -> T) (g : j -> T) : continuous f -> continuous g -> f one = g zero -> @@ -152,7 +157,7 @@ Lemma chain_path_cts_point {i j : bpTopologicalType} {T : topologicalType} Proof. by move=> cf cg fgE; apply: wedge_fun_continuous => // [[]|[] []]. Qed. Section chain_path. -Context {T : topologicalType} {i j : bpTopologicalType} (x y z: T). +Context {d d'} {T : topologicalType d} {i j : bpTopologicalType d'} (x y z : T). Context (p : {path i from x to y}) (q : {path j from y to z}). Let chain_path_zero : chain_path p q zero = x. @@ -173,9 +178,9 @@ apply: chain_path_cts_point; [exact: continuous_fun..|]. by rewrite path_zero path_one. Qed. -HB.instance Definition _ := @isContinuous.Build _ T (chain_path p q) - chain_path_cts. -HB.instance Definition _ := @isPath.Build _ T x z (chain_path p q) +HB.instance Definition _ := + @isContinuous.Build _ _ _ T (chain_path p q) chain_path_cts. +HB.instance Definition _ := @isPath.Build _ _ _ T x z (chain_path p q) chain_path_zero chain_path_one. End chain_path. diff --git a/theories/homotopy_theory/wedge_sigT.v b/theories/homotopy_theory/wedge_sigT.v index 21cf3099b8..81c2c0e5a6 100644 --- a/theories/homotopy_theory/wedge_sigT.v +++ b/theories/homotopy_theory/wedge_sigT.v @@ -56,7 +56,7 @@ Local Open Scope ring_scope. Local Open Scope quotient_scope. Section wedge. -Context {I : choiceType} (X : I -> topologicalType) (p0 : forall i, X i). +Context {I : choiceType} d (X : I -> topologicalType d) (p0 : forall i, X i). Implicit Types i : I. Let wedge_rel' (a b : {i & X i}) := @@ -91,7 +91,7 @@ Lemma wedge_lift_continuous i : continuous (@wedge_lift i). Proof. by move=> ?; apply: continuous_comp => //; exact: pi_continuous. Qed. HB.instance Definition _ i := - @isContinuous.Build _ _ (@wedge_lift i) (@wedge_lift_continuous i). + @isContinuous.Build _ _ _ _ (@wedge_lift i) (@wedge_lift_continuous i). Lemma wedge_lift_nbhs i (x : X i) : closed [set p0 i] -> x != p0 _ -> @wedge_lift i @ x = nbhs (@wedge_lift _ x). @@ -139,7 +139,7 @@ Lemma wedge_point_nbhs i0 : Proof. rewrite eqEsubset; split => //= U /=; rewrite ?nbhs_simpl. case=> V [/= oV Vp] VU j _; apply: wedge_lift_continuous. - apply: (filterS VU); first exact: (@nbhs_filter wedge). + apply: (filterS VU); first exact: (@nbhs_filter _ wedge). apply: open_nbhs_nbhs; split => //. by rewrite (wedge_liftE (p0 i0)). move=> Uj; have V_ : forall i, {V : set (X i) | @@ -205,7 +205,8 @@ Qed. Definition wedge_fun {Z : Type} (f : forall i, X i -> Z) : wedge -> Z := sigT_fun f \o repr. -Lemma wedge_fun_continuous {Z : topologicalType} (f : forall i, X i -> Z) : +Lemma wedge_fun_continuous {d'} {Z : topologicalType d'} + (f : forall i, X i -> Z) : (forall i, continuous (f i)) -> (forall i j, f i (p0 i) = f j (p0 j)) -> continuous (wedge_fun f). Proof. @@ -266,11 +267,13 @@ apply: wedge_fun_continuous; last exact: wedge_prod_pointE. exact: dfwith_continuous. Qed. +Import ExplicitNbhsDisplays. + Lemma wedge_prod_open (x : wedge) (A : set wedge) : finite_set [set: I] -> (forall i, closed [set p0 i]) -> nbhs x A -> - @nbhs _ (subspace (range wedge_prod)) (wedge_prod x) (wedge_prod @` A). + (range wedge_prod).-sub.-nbhs (wedge_prod x) (wedge_prod @` A). Proof. move=> fsetI clI; case: wedge_nbhs_specP => [//|i0 bcA|i z zNp0 /= wNz]. pose B_ i : set (subspace (range wedge_prod)) := @@ -295,7 +298,8 @@ rewrite [x in nbhs x _]/wedge_prod /= wedge_lift_funE. have : wedge_prod @` (A `&` (@wedge_lift i @` (~`[set p0 i]))) `<=` wedge_prod @` A. by move=> ? [] ? [] + /= [w] wpi => /[swap] <- Aw <-; exists (wedge_lift w). -move/filterS; apply; apply/nbhs_subspace_ex. +move/filterS; apply; first exact: (@nbhs_filter _ (subspace _)). +apply/nbhs_subspace_ex. exists (wedge_lift z) => //. by rewrite /wedge_prod wedge_lift_funE //; exact: wedge_prod_pointE. exists (proj i @^-1` (@wedge_lift i @^-1` @@ -337,7 +341,8 @@ move=> /wedge_prod_continuous nV; have := clxy _ _ nU nV. by case => z [/= ? ?]; exists (wedge_prod z). Qed. -Lemma wedge_fun_joint_continuous (T R : topologicalType) +Lemma wedge_fun_joint_continuous d' d'' + (T : topologicalType d') (R : topologicalType d'') (k : forall (x : I), T -> X x -> R): finite_set [set: I] -> (forall x, closed [set p0 x]) -> @@ -378,7 +383,7 @@ Unshelve. all: by end_near. Qed. End wedge. Section pwedge. -Context {I : pointedType} (X : I -> ptopologicalType). +Context {I : pointedType} {d} (X : I -> ptopologicalType d). Definition pwedge := wedge (fun i => @point (X i)). @@ -391,12 +396,12 @@ HB.instance Definition _ := isPointed.Build pwedge pwedge_point. End pwedge. Section bpwedge. -Context (X Y : bpTopologicalType). +Context d (X Y : bpTopologicalType d). Definition bpwedge_shared_pt b := if b return (if b then X else Y) then @one X else @zero Y. -Local Notation bpwedge := (@wedge bool _ bpwedge_shared_pt). -Local Notation bpwedge_lift := (@wedge_lift bool _ bpwedge_shared_pt). +Local Notation bpwedge := (@wedge bool _ _ bpwedge_shared_pt). +Local Notation bpwedge_lift := (@wedge_lift bool _ _ bpwedge_shared_pt). Local Lemma wedge_neq : @bpwedge_lift true zero != @bpwedge_lift false one. Proof. @@ -410,5 +415,5 @@ HB.instance Definition _ := @isBiPointed.Build bpwedge (@bpwedge_lift true zero) (@bpwedge_lift false one) wedge_neq. End bpwedge. -Notation bpwedge X Y := (@wedge bool _ (bpwedge_shared_pt X Y)). -Notation bpwedge_lift X Y := (@wedge_lift bool _ (bpwedge_shared_pt X Y)). +Notation bpwedge X Y := (@wedge bool _ _ (bpwedge_shared_pt X Y)). +Notation bpwedge_lift X Y := (@wedge_lift bool _ _ (bpwedge_shared_pt X Y)). diff --git a/theories/landau.v b/theories/landau.v index c3772a092e..63d3e790a3 100644 --- a/theories/landau.v +++ b/theories/landau.v @@ -299,7 +299,8 @@ Lemma showo : (gen_tag = tt) * (the_tag = tt) * (a_tag = tt). Proof. by []. Qed. (* Tentative to handle small o and big O notations *) Section Domination. -Context {K : numDomainType} {T : Type} {V W : normedModType K}. +Context {d d'} {K : numDomainType} {T : Type} + {V : normedModType d K} {W : normedModType d' K}. Let littleo_def (F : set_system T) (f : T -> V) (g : T -> W) := forall eps, 0 < eps -> \forall x \near F, `|f x| <= eps * `|g x|. @@ -470,7 +471,8 @@ Proof. by apply/eqoP. Qed. End Domination. Section Domination_numFieldType. -Context {K : numFieldType} {T : Type} {V W : normedModType K}. +Context {d d'} {K : numFieldType} {T : Type} + {V : normedModType d K} {W : normedModType d' K}. Let bigO_def (F : set_system T) (f : T -> V) (g : T -> W) := \forall k \near +oo, \forall x \near F, `|f x| <= k * `|g x|. @@ -703,18 +705,19 @@ Canonical the_littleo_bigO (tag : unit) (F : filter_on T) End Domination_numFieldType. -Notation "{o_ F f }" := (@littleo_type _ _ _ _ F f). -Notation "{O_ F f }" := (@bigO_type _ _ _ _ F f). +Notation "{o_ F f }" := (@littleo_type _ _ _ _ _ _ F f). +Notation "{O_ F f }" := (@bigO_type _ _ _ _ _ _ F f). Notation "[littleo 'of' f 'for' fT ]" := - (@littleo_clone _ _ _ _ _ _ f fT _ idfun). -Notation "[littleo 'of' f ]" := (@littleo_clone _ _ _ _ _ _ f _ _ idfun). + (@littleo_clone _ _ _ _ _ _ _ _ f fT _ idfun). +Notation "[littleo 'of' f ]" := (@littleo_clone _ _ _ _ _ _ _ _ f _ _ idfun). -Notation "[bigO 'of' f 'for' fT ]" := (@bigO_clone _ _ _ _ _ _ f fT _ idfun). -Notation "[bigO 'of' f ]" := (@bigO_clone _ _ _ _ _ _ f _ _ idfun). +Notation "[bigO 'of' f 'for' fT ]" := + (@bigO_clone _ _ _ _ _ _ _ _ f fT _ idfun). +Notation "[bigO 'of' f ]" := (@bigO_clone _ _ _ _ _ _ _ _ f _ _ idfun). -Arguments the_littleo {_ _ _ _} _ _ _ _ _ : simpl never. -Arguments the_bigO {_ _ _ _} _ _ _ _ _ : simpl never. +Arguments the_littleo {_ _ _ _ _ _} _ _ _ _ _ : simpl never. +Arguments the_bigO {_ _ _ _ _ _} _ _ _ _ _ : simpl never. Local Notation PhantomF x := (Phantom _ (nbhs x)). Notation mklittleo tag x := (the_littleo tag _ (PhantomF x)). @@ -823,10 +826,11 @@ Notation "fx '==O_(' x \near F ')' hx" := #[global] Hint Resolve bigO_class : core. #[global] Hint Resolve littleo_eqO : core. -Arguments bigO {_ _ _ _}. +Arguments bigO {_ _ _ _ _ _}. Section Domination_numFieldType. -Context {K : numFieldType} {T : Type} {V W : normedModType K}. +Context {d d'} {K : numFieldType} {T : Type} + {V : normedModType d K} {W : normedModType d' K}. (* duplicate from Section Domination *) Let littleo_def (F : set_system T) (f : T -> V) (g : T -> W) := @@ -841,9 +845,9 @@ by move=> _/posnumP[eps]; near do [ Unshelve. all: by end_near. Qed. Canonical add_littleo (F : filter_on T) e (df dg : {o_F e}) := - @Littleo _ _ _ _ _ _ (_ + _) (asboolT (add_littleo_subproof df dg)). + @Littleo _ _ _ _ _ _ _ _ (_ + _) (asboolT (add_littleo_subproof df dg)). Canonical addfun_littleo (F : filter_on T) e (df dg : {o_F e}) := - @Littleo _ _ _ _ _ _ (_ \+ _) (asboolT (add_littleo_subproof df dg)). + @Littleo _ _ _ _ _ _ _ _ (_ \+ _) (asboolT (add_littleo_subproof df dg)). Lemma addo (F : filter_on T) (f g: T -> V) (e : _ -> W) : [o_F e of f] + [o_F e of g] =o_F e. @@ -880,7 +884,8 @@ Proof. by move: x; rewrite -/(_ *: _ =1 _) {1}scaleo. Qed. End Domination_numFieldType. (* NB: see also scaleox *) -Lemma scaleolx (K : numFieldType) (V W : normedModType K) {T : Type} +Lemma scaleolx d d' (K : numFieldType) + (V : normedModType d K) (W : normedModType d' K) {T : Type} (F : filter_on T) (a : W) (k : T -> K^o) (e : T -> V) (x : T) : ([o_F e of k] x) *: a = [o_F e of (fun y => [o_F e of k] y *: a)] x. Proof. @@ -895,7 +900,8 @@ by rewrite lt_def normr_eq0 a0 normr_ge0. Unshelve. all: by end_near. Qed. Section Limit. -Context {K : numFieldType} {T : Type} {V W X : normedModType K}. +Context {d d' d''} {K : numFieldType} {T : Type} + {V : normedModType d K} {W : normedModType d' K} {X : normedModType d'' K}. Lemma eqolimP (F : filter_on T) (f : T -> V) (l : V) : f @ F --> l <-> f = cst l +o_F (cst (1 : K^o)). @@ -979,12 +985,13 @@ Lemma littleo_littleo (F : filter_on T) (f : T -> V) (g : T -> W) (h : T -> X) : Proof. by move=> ->; apply: eqoE; rewrite (littleo_bigO_eqo g). Qed. End Limit. -Arguments littleo_bigO_eqo {K T V W X F}. -Arguments bigO_littleo_eqo {K T V W X F}. +Arguments littleo_bigO_eqo {d d' d'' K T V W X F}. +Arguments bigO_littleo_eqo {d d' d'' K T V W X F}. Section Limit_realFieldType. -Context {K : realFieldType} (*TODO: generalize to numFieldType?*) - {T : Type} {V W X : normedModType K}. +Context {d d' d''} {K : realFieldType} (*TODO: generalize to numFieldType?*) + {T : Type} {V : normedModType d K} {W : normedModType d' K} + {X : normedModType d'' K}. Lemma bigO_bigO_eqO {F : filter_on T} (g : T -> W) (f : T -> V) (h : T -> X) : f =O_F g -> ([O_F f of h] : _ -> _) =O_F g. @@ -997,13 +1004,14 @@ Unshelve. all: by end_near. Qed. Arguments bigO_bigO_eqO {F}. End Limit_realFieldType. -Arguments littleo_bigO_eqo {K T V W X F}. -Arguments bigO_littleo_eqo {K T V W X F}. -Arguments bigO_bigO_eqO {K T V W X F}. +Arguments littleo_bigO_eqo {d d' d'' K T V W X F}. +Arguments bigO_littleo_eqo {d d' d'' K T V W X F}. +Arguments bigO_bigO_eqO {d d' d'' K T V W X F}. Section littleo_bigO_transitivity. -Context {K : numFieldType} {T : Type} {V W Z : normedModType K}. +Context {d d' d''} {K : numFieldType} {T : Type} + {V : normedModType d K} {W : normedModType d' K} {Z : normedModType d'' K}. Lemma eqaddo_trans (F : filter_on T) (f g h : T -> V) fg gh (e : T -> W): f = g + [o_ F e of fg] -> g = h + [o_F e of gh] -> f = h +o_F e. @@ -1012,7 +1020,8 @@ Proof. by move=> -> ->; rewrite -addrA addo. Qed. End littleo_bigO_transitivity. Section littleo_bigO_transitivity. -Context {K : numFieldType} {T : Type} {V W Z : normedModType K}. +Context {d d' d''} {K : numFieldType} {T : Type} + {V : normedModType d K} {W : normedModType d' K} {Z : normedModType d'' K}. Lemma eqaddO_trans (F : filter_on T) (f g h : T -> V) fg gh (e : T -> W): f = g + [O_ F e of fg] -> g = h + [O_F e of gh] -> f = h +O_F e. @@ -1040,8 +1049,9 @@ Proof. by move=> -> ->; rewrite (littleo_bigO_eqo h). Qed. End littleo_bigO_transitivity. Section littleo_bigO_transitivity_realFieldType. -Context {K : realFieldType} (*TODO: generalize to numFieldType?*) {T : Type} - {V W Z : normedModType K}. +Context {d d' d''} {K : realFieldType} (*TODO: generalize to numFieldType?*) + {T : Type} {V : normedModType d K} {W : normedModType d' K} + {Z : normedModType d'' K}. Lemma eqO_trans (F : filter_on T) (f : T -> V) f' (g : T -> W) g' (h : T -> Z) : f = [O_F g of f'] -> g = [O_F h of g'] -> f =O_F h. @@ -1099,8 +1109,8 @@ Unshelve. all: by end_near. Qed. End rule_of_products_numClosedFieldType. Section Linear3. -Context (R : realFieldType) (U : normedModType R) (V : normedModType R) - (s : GRing.Scale.law R V). +Context d d' (R : realFieldType) + (U : normedModType d R) (V : normedModType d' R) (s : GRing.Scale.law R V). Hypothesis (normm_s : forall k x, `|s k x| = `|k| * `|x|). (* Split in multiple bits *) @@ -1126,7 +1136,7 @@ suff flip : \forall k \near +oo, forall x, `|f x| <= k * `|x|. near: y; apply/nbhs_normP. eexists; last by move=> ?; rewrite /= sub0r normrN; apply. by rewrite /= mulr_gt0 // invr_gt0; near: k; exists 0. -have /nbhs_normP [_/posnumP[d]] := Of1. +have /nbhs_normP [_/posnumP[r]] := Of1. rewrite /cst [X in _ * X]normr1 mulr1 => fk; near=> k => y. case: (ler0P `|y|) => [|y0]. by rewrite normr_le0 => /eqP->; rewrite linear0 !normr0 mulr0. @@ -1142,14 +1152,14 @@ Unshelve. all: by end_near. Qed. End Linear3. -Arguments linear_for_continuous {R U V s normm_s} f _. +Arguments linear_for_continuous {d d' R U V s normm_s} f _. -Lemma linear_continuous (R : realFieldType) (U : normedModType R) - (V : normedModType R) (f : {linear U -> V}) : +Lemma linear_continuous d d' (R : realFieldType) (U : normedModType d R) + (V : normedModType d' R) (f : {linear U -> V}) : (f : _ -> _) =O_ (0 : U) (cst (1 : R^o)) -> continuous f. Proof. by apply: linear_for_continuous => ? ?; rewrite normrZ. Qed. -Lemma linear_for_mul_continuous (R : realFieldType) (U : normedModType R) +Lemma linear_for_mul_continuous d (R : realFieldType) (U : normedModType d R) (f : {linear U -> R^o | @GRing.mul R^o}) : (f : _ -> _) =O_ (0 : U) (cst (1 : R^o)) -> continuous f. Proof. by apply: linear_for_continuous => ? ?; rewrite normrZ. Qed. @@ -1159,7 +1169,8 @@ Notation "f '~~_' F g" := (f == g +o_ F g). Section asymptotic_equivalence. -Context {K : realFieldType} {T : Type} {V W : normedModType K}. +Context {d d'} {K : realFieldType} {T : Type} + {V : normedModType d K} {W : normedModType d' K}. Implicit Types F : filter_on T. Lemma equivOLR F (f g : T -> V) : f ~_F g -> f =O_F g. @@ -1168,7 +1179,7 @@ Proof. by move=> ->; apply: eqOE; rewrite {1}[g](idO F) addrC addfO. Qed. Lemma equiv_refl F (f : T -> V) : f ~_F f. Proof. by apply/eqaddoP; rewrite subrr. Qed. -Lemma equivoRL (W' : normedModType K) F (f g : T -> V) (h : T -> W') : +Lemma equivoRL d'' (W' : normedModType d'' K) F (f g : T -> V) (h : T -> W') : f ~_F g -> [o_F g of h] =o_F f. Proof. move=> ->; apply/eqoP; move=> _/posnumP[eps]; near=> x. @@ -1186,14 +1197,14 @@ move=> fg; have /(canLR (addrK _))<- := fg. by apply:eqaddoE; rewrite oppo (equivoRL _ fg). Qed. -Lemma equivoLR (W' : normedModType K) F (f g : T -> V) (h : T -> W') : +Lemma equivoLR d'' (W' : normedModType d'' K) F (f g : T -> V) (h : T -> W') : f ~_F g -> [o_F f of h] =o_F g. Proof. by move/equiv_sym/equivoRL. Qed. Lemma equivORL F (f g : T -> V) : f ~_F g -> g =O_F f. Proof. by move/equiv_sym/equivOLR. Qed. -Lemma eqoaddo (W' : normedModType K) F (f g : T -> V) (h : T -> W') : +Lemma eqoaddo d'' (W' : normedModType d'' K) F (f g : T -> V) (h : T -> W') : [o_F f + [o_F f of g] of h] =o_F f. Proof. by apply: equivoLR. Qed. @@ -1211,8 +1222,9 @@ End asymptotic_equivalence. Section big_omega. -Context {K : realFieldType} {T : Type} {V : normedModType K}. -Implicit Types W : normedModType K. +Context {d : fdisp_t} {K : realFieldType} {T : Type} + {V : normedModType d K}. +Implicit Types W : normedModType d K. Let bigOmega_def W (F : set_system T) (f : T -> V) (g : T -> W) := exists2 k, k > 0 & \forall x \near F, `|f x| >= k * `|g x|. @@ -1311,8 +1323,8 @@ Proof. rewrite !eqOmegaE !eqOmegaO => fg gh; exact: (eqO_trans gh fg). Qed. End big_omega. -Notation "{Omega_ F f }" := (@bigOmega_type _ _ _ _ F f). -Notation "[bigOmega 'of' f ]" := (@bigOmega_clone _ _ _ _ _ _ f _ _ idfun). +Notation "{Omega_ F f }" := (@bigOmega_type _ _ _ _ _ F f). +Notation "[bigOmega 'of' f ]" := (@bigOmega_clone _ _ _ _ _ _ _ f _ _ idfun). Notation mkbigOmega tag x := (the_bigOmega tag (PhantomF x)). Notation "[Omega_ x e 'of' f ]" := (mkbigOmega gen_tag x f e). Notation "[Omega '_' x e 'of' f ]" := (the_bigOmega _ _ (PhantomF x) f e). @@ -1350,8 +1362,8 @@ End big_omega_in_R. Section big_theta. -Context {K : realFieldType} {T : Type} {V : normedModType K}. -Implicit Types W : normedModType K. +Context {d} {K : realFieldType} {T : Type} {V : normedModType d K}. +Implicit Types W : normedModType d K. Let bigTheta_def W (F : set_system T) (f : T -> V) (g : T -> W) := exists2 k, (k.1 > 0) && (k.2 > 0) & @@ -1468,8 +1480,8 @@ Qed. End big_theta. -Notation "{Theta_ F g }" := (@bigTheta_type _ F g). -Notation "[bigTheta 'of' f ]" := (@bigTheta_clone _ _ _ _ _ _ f _ _ idfun). +Notation "{Theta_ F g }" := (@bigTheta_type _ _ F g). +Notation "[bigTheta 'of' f ]" := (@bigTheta_clone _ _ _ _ _ _ _ f _ _ idfun). Notation mkbigTheta tag x := (the_bigTheta tag (PhantomF x)). Notation "[Theta_ x e 'of' f ]" := (mkbigTheta gen_tag x f e). Notation "[Theta '_' x e 'of' f ]" := (the_bigTheta _ _ (PhantomF x) f e). diff --git a/theories/lebesgue_integral_theory/lebesgue_integral_differentiation.v b/theories/lebesgue_integral_theory/lebesgue_integral_differentiation.v index 41a86b07f3..e9457055f9 100644 --- a/theories/lebesgue_integral_theory/lebesgue_integral_differentiation.v +++ b/theories/lebesgue_integral_theory/lebesgue_integral_differentiation.v @@ -1124,7 +1124,8 @@ Lemma lebesgue_density (A : set R) : measurable A -> {ae mu, forall x, mu (A `&` ball x r) * (mu (ball x r))^-1 @[r --> 0^'+] --> (\1_A x)%:E}. Proof. -move=> mA; have := lebesgue_differentiation (locally_integrable_indic openT mA). +move=> mA. +have := lebesgue_differentiation (locally_integrable_indic (@openT _ _) mA). apply: filter_app. apply: aeW => /= x Ax. apply: (sube_cvg0 _ _).1 => //. diff --git a/theories/lebesgue_integral_theory/measurable_fun_approximation.v b/theories/lebesgue_integral_theory/measurable_fun_approximation.v index cc5f2ab413..c0d292a793 100644 --- a/theories/lebesgue_integral_theory/measurable_fun_approximation.v +++ b/theories/lebesgue_integral_theory/measurable_fun_approximation.v @@ -715,7 +715,7 @@ Let lusin_simple (f : {sfun R >-> rT}) (eps : rT) : (0 < eps)%R -> Proof. move: eps=> _/posnumP[eps]; have [N /card_fset_set rfN] := fimfunP f. pose Af x : set R := A `&` f @^-1` [set x]. -have mAf x : (@open R).-sigma.-measurable (Af x). +have mAf x : (@open _ R).-sigma.-measurable (Af x). exact: measurableI. have finAf x : mu (Af x) < +oo. rewrite (le_lt_trans _ finA)// le_measure// ?inE//. @@ -753,8 +753,7 @@ exists (\bigcup_(i in range f) dK i); split. + by move=> ? ? [? ?][? ?]; split; [exact: closedU|exact: withinU_continuous]. + move=> i _; split; first by apply: compact_closed; have [] := dkP i. apply: (continuous_subspaceW (dKsub i)). - apply: (@subspace_eq_continuous _ _ _ (cst i)). - by rewrite /from_subspace => ? /set_mem ->. + apply: (@subspace_eq_continuous _ _ _ _ _ (cst i)) => [? /set_mem -> //|]. exact: cst_continuous. Qed. @@ -794,8 +793,9 @@ move=> D [/= mD Deps KDf]; exists (K `\` D); split => //. by move=> k /=; apply: measurableD => //; apply: mgK. apply: (@le_trans _ _(\sum_(k // k _; apply: ltW; have [] := gKP k. -apply: (@uniform_limit_continuous_subspace _ _ _ (g_ @ \oo)) => //. -near_simpl; apply: nearW => // n; apply: (@continuous_subspaceW _ _ _ (gK n)). +apply: (@uniform_limit_continuous_subspace _ _ _ _ _ (g_ @ \oo)) => //. +near_simpl; apply: nearW => // n + ; apply: (@continuous_subspaceW _ _ _ _ _ (gK n)). by move=> z [+ _]; apply. by have [] := projT2 (cid (gK' n)). Qed. diff --git a/theories/lebesgue_integral_theory/radon_nikodym.v b/theories/lebesgue_integral_theory/radon_nikodym.v index f5c1bda84d..066c0dc486 100644 --- a/theories/lebesgue_integral_theory/radon_nikodym.v +++ b/theories/lebesgue_integral_theory/radon_nikodym.v @@ -576,7 +576,7 @@ have /cvg_ex[/= l hl] : cvg ((fun n => \sum_(0 <= i < n) \int[mu]_(y in H i) (fRN y + epsRN%:num%:E)) @ \oo). apply: is_cvg_ereal_nneg_natsum => n _. by apply: integral_ge0 => x _; rewrite adde_ge0 ?fRN_ge0. -by rewrite (@cvg_lim _ _ _ _ l). +by rewrite (@cvg_lim _ _ _ _ _ l). Qed. HB.instance Definition _ := @isCharge.Build _ _ _ sigmaRN diff --git a/theories/measure_theory/signed_measure.v b/theories/measure_theory/signed_measure.v index 400d605aec..9e7b2007cb 100644 --- a/theories/measure_theory/signed_measure.v +++ b/theories/measure_theory/signed_measure.v @@ -761,7 +761,7 @@ have nudelta n : nu E <= g_ (v n). apply/ereal_sup_le => x/= [A' [mA' A'D ?]]. exists A' => //; split => //. by apply: (subset_trans A'D); apply: setDS; rewrite Ubig. -apply: (@closed_cvg _ _ _ _ _ (fun v => nu E <= v) _ _ _ g_cvg_0) => //. +apply: (@closed_cvg _ _ _ _ _ _ (fun v => nu E <= v) _ _ _ g_cvg_0) => //. exact: closed_ereal_le_ereal. exact: nearW. Unshelve. all: by end_near. Qed. diff --git a/theories/normedtype_theory/complete_normed_module.v b/theories/normedtype_theory/complete_normed_module.v index 04b8389fde..21cccc838c 100644 --- a/theories/normedtype_theory/complete_normed_module.v +++ b/theories/normedtype_theory/complete_normed_module.v @@ -28,8 +28,8 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. #[short(type="completeNormedModType")] -HB.structure Definition CompleteNormedModule (K : numFieldType) := - {T of NormedModule K T & Complete T}. +HB.structure Definition CompleteNormedModule d (K : numFieldType) := + {T of NormedModule d K T & Complete d T}. Lemma R_complete (R : realType) (F : set_system R) : ProperFilter F -> cauchy F -> cvg F. @@ -61,7 +61,7 @@ rewrite /ball_/= ltr_distl ltrBlDr. by move=> /andP [/ltW /(le_trans _) le_xeps _ /le_xeps]. Unshelve. all: by end_near. Qed. -HB.instance Definition _ (R : realType) := Uniform_isComplete.Build R^o +HB.instance Definition _ (R : realType) := Uniform_isComplete.Build _ R^o (@R_complete R). (* TODO: delete *) HB.instance Definition _ (R : realType) := Complete.copy R R^o. diff --git a/theories/normedtype_theory/ereal_normedtype.v b/theories/normedtype_theory/ereal_normedtype.v index 105cc2e833..75ea33cdd8 100644 --- a/theories/normedtype_theory/ereal_normedtype.v +++ b/theories/normedtype_theory/ereal_normedtype.v @@ -40,7 +40,7 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section limf_esup_einf. -Context {T : choiceType} {X : filteredType T} {R : realFieldType}. +Context {d} {T : choiceType} {X : filteredType d T} {R : realFieldType}. Implicit Types (f : X -> \bar R) (F : set_system X). Local Open Scope ereal_scope. @@ -69,7 +69,7 @@ Proof. by rewrite /limf_einf; under eq_fun do rewrite oppeK. Qed. End limf_esup_einf. Section limf_esup_einf_realType. -Variables (T : choiceType) (X : filteredType T) (R : realType). +Context d (T : choiceType) (X : filteredType d T) (R : realType). Implicit Types (f : X -> \bar R) (F : set_system X). Local Open Scope ereal_scope. @@ -84,7 +84,7 @@ Qed. End limf_esup_einf_realType. Section lower_semicontinuous. -Context {X : topologicalType} {R : numFieldType}. +Context {d} {X : topologicalType d} {R : numFieldType}. Implicit Types f : X -> \bar R. Local Open Scope ereal_scope. @@ -507,6 +507,7 @@ apply/seteqP; split=> A. + by rewrite set_itvE/= subTset => _ ->; exact: filter_nbhsT. Qed. -HB.instance Definition _ := Order_isNbhs.Build _ (\bar R) ereal_order_nbhsE. +HB.instance Definition _ := + Order_isNbhs.Build default_fdisp _ (\bar R) ereal_order_nbhsE. End ereal_OrderNbhs. diff --git a/theories/normedtype_theory/matrix_normedtype.v b/theories/normedtype_theory/matrix_normedtype.v index fe89c0f33b..9c320761ba 100644 --- a/theories/normedtype_theory/matrix_normedtype.v +++ b/theories/normedtype_theory/matrix_normedtype.v @@ -38,13 +38,13 @@ move=> /= M s /= /(nbhs_ballP (M i j)) [e e0 es]. by apply/nbhs_ballP; exists e => //= N [_ MN]; exact/es/MN. Qed. -#[local] Lemma rV_compact_nondegenerate (T : ptopologicalType) n +#[local] Lemma rV_compact_nondegenerate d (T : ptopologicalType d) n (A : 'I_n.+1 -> set T) : (forall i, compact (A i)) -> compact [ set v : 'rV[T]_n.+1 | forall i, A i (v ord0 i)]. Proof. move=> Aico. -have : @compact (prod_topology _) [set f | forall i, A i (f i)]. +have : @compact _ (prod_topology _) [set f | forall i, A i (f i)]. by apply: tychonoff. move=> Aco F FF FA. set G := [set [set f : 'I_n.+1 -> T | B (\row_j f j)] | B in F]. @@ -53,7 +53,7 @@ have row_simpl (v : 'rV[T]_n.+1) : \row_j (v ord0 j) = v. have row_simpl' (f : 'I_n.+1 -> T) : (\row_j f j) ord0 = f. by rewrite funeqE=> ?; rewrite mxE. have [f [Af clGf]] : [set f | forall i, A i (f i)] `&` - @cluster (prod_topology _) G !=set0. + @cluster _ (prod_topology _) G !=set0. suff GF : ProperFilter G. apply: Aco; exists [set v : 'rV[T]_n.+1 | forall i, A i (v ord0 i)] => //. by rewrite predeqE => f; split => Af i; [have := Af i|]; rewrite row_simpl'. @@ -96,7 +96,7 @@ have GC : G [set g | C (\row_j g j)] by exists C. by have [g []] := clGf _ _ GC f_D; exists (\row_j (g j : T)). Qed. -Lemma rV_compact (T : ptopologicalType) n (A : 'I_n -> set T) : +Lemma rV_compact d (T : ptopologicalType d) n (A : 'I_n -> set T) : (forall i, compact (A i)) -> compact [ set v : 'rV[T]_n | forall i, A i (v ord0 i)]. Proof. @@ -216,7 +216,7 @@ Context {K : numFieldType} {m n : nat}. Local Lemma ball_gt0 (x y : 'M[K]_(m, n)) e : ball x e y -> 0 < e. Proof. by case. Qed. -Lemma mx_norm_ball : @ball _ 'M[K]_(m, n) = ball_ (fun x => `| x |). +Lemma mx_norm_ball : @ball _ _ 'M[K]_(m, n) = ball_ (fun x => `| x |). Proof. rewrite /normr /ball_ predeq3E => x e y/= /[!mx_normE]; split=> [[]|xey]. - move=> /[dup] => /ltW/nonnegP[{}e] e_gt0 xey. @@ -230,14 +230,14 @@ rewrite /normr /ball_ predeq3E => x e y/= /[!mx_normE]; split=> [[]|xey]. Qed. HB.instance Definition _ := - NormedZmod_PseudoMetric_eq.Build K 'M[K]_(m, n) mx_norm_ball. + NormedZmod_PseudoMetric_eq.Build _ K 'M[K]_(m, n) mx_norm_ball. -HB.instance Definition _ := isPseudoMetricNormedZmodule.Build _ 'M[K]_(m, n). +HB.instance Definition _ := isPseudoMetricNormedZmodule.Build _ _ 'M[K]_(m, n). End matrix_pseudoMetricNormedZmod. Section within_continuous_coord. -Context {T : topologicalType} {R : realFieldType} {n : nat}. +Context {d} {T : topologicalType d} {R : realFieldType} {n : nat}. Import numFieldNormedType.Exports. Lemma within_continuous_coord A (f : T -> 'rV[R]_n) : @@ -264,7 +264,7 @@ Proof. move=> [M [Mreal normAltM]] Acl. have Mnco : compact [set v : 'rV[R]_n | forall i, v ord0 i \in `[(- (M + 1)), (M + 1)]]. - apply: (@rV_compact _ _ (fun=> `[(- (M + 1)), (M + 1)]%classic)). + apply: (@rV_compact _ _ _ (fun=> `[(- (M + 1)), (M + 1)]%classic)). by move=> _; apply: segment_compact. apply: subclosed_compact Acl Mnco _ => v /normAltM normvleM i. suff : `|v ord0 i : R| <= M + 1 by rewrite ler_norml. @@ -293,20 +293,20 @@ Section matrix_UniformNZmodule. Context {K : numFieldType} {m n : nat}. HB.instance Definition _ := PreUniformNmodule_isUniformNmodule.Build - 'M[K]_(m, n) (@PseudoMetricNormedZmodule_add_unif_continuous _ _). + _ 'M[K]_(m, n) (@PseudoMetricNormedZmodule_add_unif_continuous _ _ _). HB.instance Definition _ := UniformNmodule_isUniformZmodule.Build - 'M[K]_(m, n) (@PseudoMetricNormedZmodule_opp_unif_continuous _ _). + _ 'M[K]_(m, n) (@PseudoMetricNormedZmodule_opp_unif_continuous _ _ _). End matrix_UniformNZmodule. HB.instance Definition _ (K : numFieldType) m n := - PseudoMetricNormedZmod_Lmodule_isNormedModule.Build K 'M[K]_(m, n) + PseudoMetricNormedZmod_Lmodule_isNormedModule.Build _ K 'M[K]_(m, n) (@mx_normZ K m n). End matrix_NormedModule. -Lemma continuous_mx {V : topologicalType} {R : realFieldType} {m n : nat} +Lemma continuous_mx {d} {V : topologicalType d} {R : realFieldType} {m n : nat} (f : V -> 'M[R]_(m, n)) : (forall i j, continuous (fun x => f x i j)) <-> continuous (fun x : V => \matrix_(i < m, j < n) f x i j). @@ -317,9 +317,9 @@ split => [cf x|cf i j v]. rewrite !mxE/=. move: i j; near: t. apply: filter_forall => /= i; apply: filter_forall => /= j. - have /(@cvgrPdist_le _ R^o)/(_ _ e0) := cf i j x. + have /(@cvgrPdist_le _ _ R^o)/(_ _ e0) := cf i j x. exact: filterS. -- apply/(@cvgrPdist_le _ R^o) => /= e e0. +- apply/(@cvgrPdist_le _ _ R^o) => /= e e0. have /cvgrPdist_le/(_ _ e0) := cf v. apply: filterS => w. apply: le_trans. diff --git a/theories/normedtype_theory/normed_module.v b/theories/normedtype_theory/normed_module.v index a8528fecdb..c07faa388f 100644 --- a/theories/normedtype_theory/normed_module.v +++ b/theories/normedtype_theory/normed_module.v @@ -87,14 +87,14 @@ Local Open Scope ring_scope. (** Modules with a norm depending on a numDomain *) HB.mixin Record MetricNormedZmod_ConvexTvs_isNormedModule - (K : numDomainType) V & MetricNormedZmodule K V & ConvexTvs K V := { + d (K : numDomainType) V & MetricNormedZmodule d K V & ConvexTvs d K V := { normrZ : forall (l : K) (x : V), `| l *: x | = `| l | * `| x |; }. #[deprecated(since="mathcomp-analysis 1.19.0", use=MetricNormedZmod_ConvexTvs_isNormedModule)] Notation PseudoMetricNormedZmod_ConvexTvs_isNormedModule x1 x2 := - (MetricNormedZmod_ConvexTvs_isNormedModule x1 x2). + (MetricNormedZmod_ConvexTvs_isNormedModule _ x1 x2). Module PseudoMetricNormedZmod_ConvexTvs_isNormedModule. #[deprecated(since="mathcomp-analysis 1.19.0", @@ -104,29 +104,29 @@ Notation Build x1 x2 x3 := End PseudoMetricNormedZmod_ConvexTvs_isNormedModule. #[short(type="normedModType")] -HB.structure Definition NormedModule (K : numDomainType) := - {T of MetricNormedZmodule K T & ConvexTvs K T - & MetricNormedZmod_ConvexTvs_isNormedModule K T}. +HB.structure Definition NormedModule d (K : numDomainType) := + {T of MetricNormedZmodule d K T & ConvexTvs d K T + & MetricNormedZmod_ConvexTvs_isNormedModule d K T}. #[short(type="subNormedModType")] -HB.structure Definition SubNormedModule (R : numDomainType) - (V : normedModType R) (S : pred V) := - { U of SubChoice V S U & NormedModule R U & @GRing.SubLmodule R V S U - & @Num.SubNormedZmodule R V S U & @SubConvexTvs R V S U}. +HB.structure Definition SubNormedModule d d' (R : numDomainType) + (V : normedModType d R) (S : pred V) := + { U of SubChoice V S U & NormedModule d' R U & @GRing.SubLmodule R V S U + & @Num.SubNormedZmodule R V S U & @SubConvexTvs d d' R V S U}. HB.factory Record PseudoMetricNormedZmod_Lmodule_isNormedModule - (K : numFieldType) V & MetricNormedZmodule K V & GRing.Lmodule K V := { + d (K : numFieldType) V & MetricNormedZmodule d K V & GRing.Lmodule K V := { normrZ : forall (l : K) (x : V), `| l *: x | = `| l | * `| x |; }. -HB.builders Context K V & PseudoMetricNormedZmod_Lmodule_isNormedModule K V. +HB.builders Context d K V & PseudoMetricNormedZmod_Lmodule_isNormedModule d K V. (** NB: we have almost the same proof in `tvs.v` *) Let scale_continuous : continuous (fun z : K^o * V => z.1 *: z.2). Proof. move=> [/= k x]; apply/cvgrPdist_lt => _/posnumP[e]; near +oo_K => M. near=> l z => /=; have M0 : 0 < M by []. -rewrite (@distm_lt_split _ _ (k *: z)) // -?(scalerBr, scalerBl) normrZ. +rewrite (@distm_lt_split _ _ _ (k *: z)) // -?(scalerBr, scalerBl) normrZ. rewrite (@le_lt_trans _ _ (M * `|x - z|)) ?ler_wpM2r -?ltr_pdivlMl//. by near: z; apply: cvgr_dist_lt; rewrite // mulr_gt0 ?invr_gt0. rewrite (@le_lt_trans _ _ (`|k - l| * M)) ?ler_wpM2l -?ltr_pdivlMr//. @@ -173,17 +173,17 @@ Qed. (*HB.instance Definition _ := PreTopologicalNmodule_isTopologicalNmodule.Build V add_continuous.*) HB.instance Definition _ := - TopologicalNmodule_isTopologicalLmodule.Build K V scale_continuous. -HB.instance Definition _ := Uniform_isConvexTvs.Build K V locally_convex_set. + TopologicalNmodule_isTopologicalLmodule.Build _ K V scale_continuous. +HB.instance Definition _ := Uniform_isConvexTvs.Build _ K V locally_convex_set. HB.instance Definition _ := - MetricNormedZmod_ConvexTvs_isNormedModule.Build K V normrZ. + MetricNormedZmod_ConvexTvs_isNormedModule.Build _ K V normrZ. HB.end. #[short(type="normedVectType")] -HB.structure Definition NormedVector (K : numDomainType) := - {T of NormedModule K T & Vector K T}. +HB.structure Definition NormedVector d (K : numDomainType) := + {T of NormedModule d K T & Vector K T}. (**md see also `Section standard_topology_metricNormedZmod` in `pseudometric_normed_Zmodule.v` *) @@ -196,7 +196,7 @@ HB.instance Definition _ := TopologicalZmodule_isTopologicalLmodule.Build *) HB.instance Definition _ := - MetricNormedZmod_ConvexTvs_isNormedModule.Build R R^o (@normrM _). + MetricNormedZmod_ConvexTvs_isNormedModule.Build _ R R^o (@normrM _). End standard_topology_normedMod. @@ -275,8 +275,8 @@ Module Exports. Export numFieldTopology.Exports. HB.reexport. End Exports. End numFieldNormedType. Import numFieldNormedType.Exports. -Lemma within_continuous_compN {R : realFieldType} {K : numDomainType} - {U : metricNormedZmodType K} (f : R -> U) (a b : R) : +Lemma within_continuous_compN {d} {R : realFieldType} {K : numDomainType} + {U : metricNormedZmodType d K} (f : R -> U) (a b : R) : {within `[- b, - a], continuous f} -> {within `[a, b], continuous f \o -%R}. Proof. have [ab|ba _ |-> _] := ltgtP a b; last 2 first. @@ -312,7 +312,8 @@ Definition nbhs (x : T) : set_system T := nbhs_ ent x. Lemma nbhsE : nbhs = nbhs_ ent. Proof. by []. Qed. -#[export] HB.instance Definition _ := hasNbhs.Build T nbhs. +#[export] HB.instance Definition _ := + hasNbhs.Build default_fdisp T nbhs. Lemma ball_center x (e : K) : 0 < e -> ball x e x. Proof. by rewrite /ball/= subrr normr0. Qed. @@ -331,7 +332,7 @@ Qed. Lemma entourageE : ent = entourage_ ball. Proof. by []. Qed. -#[export] HB.instance Definition _ := @Nbhs_isPseudoMetric.Build K T +#[export] HB.instance Definition _ := @Nbhs_isPseudoMetric.Build _ K T ent nbhsE ball ball_center ball_sym ball_triangle entourageE. End pseudoMetric_from_normedZmodType. @@ -349,7 +350,7 @@ Global Instance ent_xsection_filter {R : realFieldType} (U : normedZmodType R) x ent A & xsection A x `<=` P]. Proof. apply: Build_Filter => /=. -- by exists setT => //; exact: (@entourageT (pseudoMetric_normed U)). +- by exists setT => //; exact: (@entourageT _ (pseudoMetric_normed U)). - move=> A B/= [A' [r/= r0 ballA'] A'A] [B' [d/= d0 ballB'] B'B]. exists (A' `&` B'); last by rewrite xsectionI; exact: setISS. rewrite entourageE /entourage_. @@ -388,26 +389,26 @@ HB.instance Definition _ := PseudoMetric.copy M (pseudoMetric_normed M). HB.instance Definition _ := isPointed.Build M 0. -HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build R M erefl. +HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build _ R M erefl. -HB.instance Definition _ := isPseudoMetricNormedZmodule.Build R M. +HB.instance Definition _ := isPseudoMetricNormedZmodule.Build _ R M. HB.instance Definition _ := PreUniformNmodule_isUniformNmodule.Build - M (@PseudoMetricNormedZmodule_add_unif_continuous _ M). + _ M (@PseudoMetricNormedZmodule_add_unif_continuous _ _ M). HB.instance Definition _ := UniformNmodule_isUniformZmodule.Build - M (@PseudoMetricNormedZmodule_opp_unif_continuous _ M). + _ M (@PseudoMetricNormedZmodule_opp_unif_continuous _ _ M). HB.instance Definition _ := - PseudoMetricNormedZmod_Lmodule_isNormedModule.Build R M normrZ. + PseudoMetricNormedZmod_Lmodule_isNormedModule.Build _ R M normrZ. HB.end. -Definition subLmodule_isSubNormedmodule (R : realFieldType) - (V : normedModType R) (S : pred V) (U : Type) : Type := U. +Definition subLmodule_isSubNormedmodule d (R : realFieldType) + (V : normedModType d R) (S : pred V) (U : Type) : Type := U. Section SubLmodule_isSubNormedmodule. -Context (R : realFieldType) (V : normedModType R) (S : pred V) +Context d (R : realFieldType) (V : normedModType d R) (S : pred V) (U' : subLmodType S). Local Notation U := (subLmodule_isSubNormedmodule S U'). @@ -450,7 +451,7 @@ rewrite -GRing.valN -GRing.valD normu_valE. by near: t; exact: cvgr_dist_le e e0. Unshelve. all: by end_near. Qed. -HB.instance Definition _ := isSubNbhs.Build _ _ U continuous_valE. +HB.instance Definition _ := isSubNbhs.Build _ _ _ _ U continuous_valE. End SubLmodule_isSubNormedmodule. @@ -487,23 +488,24 @@ rewrite inE; apply: subset_itv_oo_cc. by near: z; exact: near_in_itvoo. Unshelve. all: by end_near. Qed. -Lemma normrZV (K : numDomainType) (V : normedModType K) (x : V) : +Lemma normrZV d (K : numDomainType) (V : normedModType d K) (x : V) : `|x| \in GRing.unit -> `| `| x |^-1 *: x | = 1. Proof. by move=> nxu; rewrite normrZ normrV// normr_id mulVr. Qed. -HB.instance Definition _ (K : numDomainType) (V : normedModType K) := +HB.instance Definition _ d (K : numDomainType) (V : normedModType d K) := Norm.isSemiNorm.Build K V (@Num.norm K V) (normr0 V) - (@normr_ge0 _ V) (@ler_normD _ V) (@normrZ _ V). + (@normr_ge0 _ V) (@ler_normD _ V) (@normrZ _ _ V). -HB.instance Definition _ (K : numDomainType) (V : normedModType K) := +HB.instance Definition _ d (K : numDomainType) (V : normedModType d K) := Norm.SemiNorm_isNorm.Build K V (@Num.norm K V) (@normr0_eq0 _ V). -Definition self_sub (K : numDomainType) (V W : normedModType K) +Definition self_sub d d' (K : numDomainType) + (V : normedModType d K) (W : normedModType d' K) (f : V -> W) (x : V * V) : W := f x.1 - f x.2. -Arguments self_sub {K V W} f x /. +Arguments self_sub {d d' K V W} f x /. Section NormedModule_numFieldType. -Context {K : numFieldType} {V : normedModType K}. +Context {d} {K : numFieldType} {V : normedModType d K}. Lemma normfZV (x : V) : x != 0 -> `| `|x|^-1 *: x | = 1. Proof. by rewrite -normr_eq0 -unitfE => /normrZV->. Qed. @@ -529,20 +531,21 @@ Arguments scale_continuous _ _ : clear implicits. Lemma scaler_continuous k : continuous (fun x : V => k *: x). Proof. -by move=> x; exact: (cvg_comp2 _ cvg_id (scale_continuous _ _ (_, _))). +by move=> x; exact: (cvg_comp2 _ cvg_id (scale_continuous _ _ _ (_, _))). Qed. Lemma scalel_continuous (x : V) : continuous (fun k : K => k *: x). Proof. -by move=> k; apply: (cvg_comp2 cvg_id _ (scale_continuous _ _ (_, _))). +by move=> k; apply: (cvg_comp2 cvg_id _ (scale_continuous _ _ _ (_, _))). Qed. End NormedModule_numFieldType. -Arguments cvg_at_rightE {K V} f x. -Arguments cvg_at_leftE {K V} f x. +Arguments cvg_at_rightE {d K V} f x. +Arguments cvg_at_leftE {d K V} f x. Section NormedModule_continuous. -Variables (K : numFieldType) (U V : normedModType K). +Context (d d' : fdisp_t) (K : numFieldType) + (U : normedModType d K) (V : normedModType d' K). Lemma continuous_shift (f : U -> V) u : {for u, continuous f} = {for 0, continuous (f \o shift u)}. @@ -560,10 +563,10 @@ Qed. End NormedModule_continuous. -Lemma near0Z {R : numFieldType} {V : normedModType R} (y : V) (P : set V) : +Lemma near0Z d {R : numFieldType} {V : normedModType d R} (y : V) (P : set V) : (\forall x \near 0, P x) -> (\forall k \near 0, P (k *: y)). Proof. -by have /= := @scalel_continuous R V y 0 _; rewrite scale0r; apply. +by have /= := @scalel_continuous d R V y 0 _; rewrite scale0r; apply. Qed. Section NVS_continuity_mul. @@ -581,7 +584,7 @@ Proof. exact: scalel_continuous. Qed. Lemma inv_continuous (x : K) : x != 0 -> {for x, continuous (@GRing.inv K)}. Proof. move=> x_neq0; have nx_gt0 : `|x| > 0 by rewrite normr_gt0. -apply/(@cvgrPdist_ltp _ _ _ (nbhs x)); near (0 : K)^'+ => d. near=> e. +apply/(@cvgrPdist_ltp _ _ _ _ (nbhs x)); near (0 : K)^'+ => d. near=> e. near=> y; have y_neq0 : y != 0 by near: y; apply: (cvgr_neq0 x). rewrite /= -div1r -[y^-1]div1r -mulNr addf_div// mul1r mulN1r normrM normfV. rewrite ltr_pdivrMr ?normr_gt0 ?mulf_neq0// (@lt_le_trans _ _ (e * d))//. @@ -594,7 +597,7 @@ Unshelve. all: by end_near. Qed. End NVS_continuity_mul. Section cvg_composition_normed. -Context {K : numFieldType} {V : normedModType K} {T : Type} +Context {d} {K : numFieldType} {V : normedModType d K} {T : Type} (F : set_system T) {FF : Filter F}. Implicit Types (f g : T -> V) (s : T -> K) (k : K) (x : T) (a b : V). @@ -602,7 +605,7 @@ Lemma cvgZ s f k a : s @ F --> k -> f @ F --> a -> s x *: f x @[x --> F] --> k *: a. Proof. move=> ? ?; apply: continuous2_cvg => //. -exact: (@scale_continuous K V (k, a)). +exact: (@scale_continuous _ K V (k, a)). Qed. Lemma is_cvgZ s f : cvg (s @ F) -> @@ -639,8 +642,8 @@ Qed. End cvg_composition_normed. -Lemma within_continuousZ (T : topologicalType) (A : set T) (K : numFieldType) - (V : normedModType K) (k : K) (f : T -> V) : +Lemma within_continuousZ d d' (T : topologicalType d) + (A : set T) (K : numFieldType) (V : normedModType d' K) (k : K) (f : T -> V) : {within A, continuous f} -> {within A, continuous k *: f}. Proof. by move=> cf x; apply: cvgZl_tmp; exact: cf. Qed. @@ -730,7 +733,7 @@ Notation is_cvgMlE := is_cvgMrE_tmp (only parsing). Notation is_cvgMrE := is_cvgMlE_tmp (only parsing). Section within_continuous_lemmas. -Context {T : topologicalType} {K : numFieldType} (A : set T). +Context {d} {T : topologicalType d} {K : numFieldType} (A : set T). Implicit Types f g : T -> K. Lemma within_continuousM f g : {within A, continuous f} -> @@ -748,7 +751,7 @@ Proof. by move=> cf x; apply: cvgMr_tmp; exact: cf. Qed. End within_continuous_lemmas. Section limit_composition_normed. -Context {K : numFieldType} {V : normedModType K} {T : Type}. +Context {d} {K : numFieldType} {V : normedModType d K} {T : Type}. Context (F : set_system T) {FF : ProperFilter F}. Implicit Types (f g : T -> V) (s : T -> K) (k : K) (x : T) (a : V). @@ -819,7 +822,8 @@ Proof. exact: cvgr_to_le. Qed. End ProperFilterRealType. Section local_continuity. -Context {K : numFieldType} {V : normedModType K} {T : topologicalType}. +Context {d d'} {K : numFieldType} + {V : normedModType d K} {T : topologicalType d'}. Implicit Types (f g : T -> V) (s t : T -> K) (x : T) (k : K) (a : V). Lemma continuousN (f : T -> V) x : @@ -943,7 +947,7 @@ Qed. Lemma abse_continuous : continuous (@abse R). Proof. case=> [r|A /= [r [rreal rA]]|A /= [r [rreal rA]]]/=. -- exact/(cvg_comp _ _ (@norm_continuous _ R r)). +- exact/(cvg_comp _ _ (@norm_continuous _ _ R r)). - by exists r; split => // y ry; apply: rA; rewrite (lt_le_trans ry)// lee_abs. - exists (- r)%R; rewrite realN; split => // y; rewrite EFinN -lteNr => yr. by apply: rA; rewrite (lt_le_trans yr)// -abseN lee_abs. @@ -1110,7 +1114,7 @@ Unshelve. all: end_near. Qed. End ecvg_realFieldType. Section max_cts. -Context {R : realType} {T : topologicalType}. +Context {d} {R : realType} {T : topologicalType d}. Lemma continuous_min (f g : T -> R^o) x : {for x, continuous f} -> {for x, continuous g} -> @@ -1353,8 +1357,8 @@ Unshelve. all: end_near. Qed. End FilterRealType. Section TopoProperFilterRealType. -Context {T : topologicalType} {F : set_system T} {Fa : ProperFilter F}. -Context {R : realFieldType}. +Context {d} {T : topologicalType d} {F : set_system T} {Fa : ProperFilter F} + {R : realFieldType}. Implicit Types f g h : T -> R. Lemma ler_cvg_to f g (l l' : R) : f @ F --> l -> g @ F --> l' -> @@ -1416,7 +1420,7 @@ Arguments squeeze_fin {T F FF R} f g h. Arguments squeeze_cvge {T F FF R} f g h. Section TopoProperFilterERealType. -Context {T : topologicalType} {F : set_system T} {FF : ProperFilter F} +Context {d} {T : topologicalType d} {F : set_system T} {FF : ProperFilter F} {R : realFieldType}. Local Open Scope ereal_scope. Implicit Types f g h : T -> \bar R. @@ -1476,27 +1480,27 @@ case: (asboolP (has_lbound _)) => ?; case: (asboolP (has_ubound _)) => ? //=. rewrite !(lteifF, lteifT). + move=> /andP[]; rewrite le_eqVlt => /orP[/eqP <- //|infXx]. rewrite le_eqVlt => /orP[/eqP -> //|xsupX]. - apply: (@interior_subset R). + apply: (@interior_subset _ R). by rewrite interval_bounded_interior // /mkset infXx. + move=> /andP[]; rewrite le_eqVlt => /orP[/eqP <- //|infXx supXx]. - apply: (@interior_subset R). + apply: (@interior_subset _ R). by rewrite interval_bounded_interior // /mkset infXx. + move=> /andP[infXx]; rewrite le_eqVlt => /orP[/eqP -> //|xsupX]. - apply: (@interior_subset R). + apply: (@interior_subset _ R). by rewrite interval_bounded_interior // /mkset infXx. - + move=> ?; apply: (@interior_subset R). + + move=> ?; apply: (@interior_subset _ R). by rewrite interval_bounded_interior // /mkset infXx. - case: asboolP => XinfX; rewrite !(lteifF, lteifT, andbT). + rewrite le_eqVlt => /orP[/eqP<-//|infXx]. - apply: (@interior_subset R). + apply: (@interior_subset _ R). by rewrite interval_right_unbounded_interior. - + move=> infXx; apply: (@interior_subset R). + + move=> infXx; apply: (@interior_subset _ R). by rewrite interval_right_unbounded_interior. - case: asboolP => XsupX /=. + rewrite le_eqVlt => /orP[/eqP->//|xsupX]. - apply: (@interior_subset R). + apply: (@interior_subset _ R). by rewrite interval_left_unbounded_interior. - + move=> xsupX; apply: (@interior_subset R). + + move=> xsupX; apply: (@interior_subset _ R). by rewrite interval_left_unbounded_interior. - by move=> _; rewrite (interval_unbounded_setT iX). Qed. @@ -1751,13 +1755,14 @@ exact: segment_connected. Qed. Section prod_normedModType. -Context {K : numFieldType} {U V : normedModType K}. +Context {d d'} {K : numFieldType} + {U : normedModType d K} {V : normedModType d' K}. Let prod_norm_scale (l : K) (x : U * V) : `| l *: x | = `|l| * `| x |. Proof. by rewrite prod_normE /= !normrZ maxr_pMr. Qed. HB.instance Definition _ := MetricNormedZmod_ConvexTvs_isNormedModule.Build - K (U * V)%type prod_norm_scale. + _ K (U * V)%type prod_norm_scale. End prod_normedModType. @@ -1911,8 +1916,8 @@ End prod_normedModType. (* by apply (Hd (u, v)) => /=; split; apply sub_abs_ball; rewrite absrB. *) (* Qed. *) -Lemma bounded_locally (T : topologicalType) - (R : numFieldType) (V : normedModType R) (A : set T) (f : T -> V) : +Lemma bounded_locally d d' (T : topologicalType d) + (R : numFieldType) (V : normedModType d' R) (A : set T) (f : T -> V) : [bounded f x | x in A] -> [locally [bounded f x | x in A]]. Proof. by move=> /sub_boundedr AB x Ax; apply: AB; apply: within_nbhsW. Qed. @@ -1950,22 +1955,26 @@ End bounded_mul. Notation "k .-lipschitz_on f" := (dominated_by (self_sub id) k (self_sub f)) : type_scope. -Lemma sub_klipschitz (K : numFieldType) (V W : normedModType K) (k : K) +Lemma sub_klipschitz d d' (K : numFieldType) + (V : normedModType d K) (W : normedModType d' K) (k : K) (f : V -> W) (F G : set_system (V * V)) : F `=>` G -> k.-lipschitz_on f G -> k.-lipschitz_on f F. Proof. exact. Qed. -Definition lipschitz_on (K : numFieldType) (V W : normedModType K) - (f : V -> W) (F : set_system (V * V)) := +Definition lipschitz_on d d' (K : numFieldType) + (V : normedModType d K) (W : normedModType d' K) + (f : V -> W) (F : set_system (V * V)) := \forall M \near +oo, M.-lipschitz_on f F. -Lemma sub_lipschitz (K : numFieldType) (V W : normedModType K) +Lemma sub_lipschitz d d' (K : numFieldType) + (V : normedModType d K) (W : normedModType d' K) (f : V -> W) (F G : set_system (V * V)) : F `=>` G -> lipschitz_on f G -> lipschitz_on f F. Proof. by move=> FG; rewrite /lipschitz_on; apply: filterS => M; apply: FG. Qed. -Lemma klipschitzW (K : numFieldType) (V W : normedModType K) (k : K) - (f : V -> W) (F : set_system (V * V)) {PF : ProperFilter F} : +Lemma klipschitzW d d' (K : numFieldType) + (V : normedModType d K) (W : normedModType d' K) (k : K) + (f : V -> W) (F : set_system (V * V)) {PF : ProperFilter F} : k.-lipschitz_on f F -> lipschitz_on f F. Proof. by move=> f_lip; apply/ex_dom_bound; exists k. Qed. @@ -1976,35 +1985,40 @@ Notation "[ 'lipschitz' E | x 'in' A ]" := (lipschitz_on (fun x => E) (globally (A `*` A))) : type_scope. Notation lipschitz f := [lipschitz f x | x in setT]. -Lemma lipschitz_set0 (K : numFieldType) (V W : normedModType K) +Lemma lipschitz_set0 d d' (K : numFieldType) + (V : normedModType d K) (W : normedModType d' K) (f : V -> W) : [lipschitz f x | x in set0]. Proof. by apply: nearW; rewrite setX0 => ?; apply: globally0. Qed. -Lemma lipschitz_set1 (K : numFieldType) (V W : normedModType K) +Lemma lipschitz_set1 d d' (K : numFieldType) + (V : normedModType d K) (W : normedModType d' K) (f : V -> W) (a : V) : [lipschitz f x | x in [set a]]. Proof. -apply: (@klipschitzW _ _ _ `|f a|). +apply: (@klipschitzW _ _ _ _ _ `|f a|). exact: (@globally_properfilter _ _ (a, a)). by move=> [x y] /= [] -> ->; rewrite !subrr !normr0 mulr0. Qed. -Lemma klipschitz_locally (R : numFieldType) (V W : normedModType R) (k : R) +Lemma klipschitz_locally d d' (R : numFieldType) + (V : normedModType d R) (W : normedModType d' R) (k : R) (f : V -> W) (A : set V) : k.-lipschitz_A f -> [locally k.-lipschitz_A f]. Proof. by move=> + x Ax; apply: sub_klipschitz; apply: within_nbhsW. Qed. -Lemma lipschitz_locally (R : numFieldType) (V W : normedModType R) +Lemma lipschitz_locally d d' (R : numFieldType) + (V : normedModType d R) (W : normedModType d' R) (A : set V) (f : V -> W) : [lipschitz f x | x in A] -> [locally [lipschitz f x | x in A]]. Proof. by move=> + x Ax; apply: sub_lipschitz; apply: within_nbhsW. Qed. -Lemma lipschitz_id (R : numFieldType) (V : normedModType R) : +Lemma lipschitz_id d (R : numFieldType) (V : normedModType d R) : 1.-lipschitz (@id V). Proof. by move=> [/= x y] _; rewrite mul1r. Qed. -Arguments lipschitz_id {R V}. +Arguments lipschitz_id {d R V}. Section LinearContinuousBounded. -Variables (R : numFieldType) (V W : normedModType R). +Context d d' (R : numFieldType) + (V : normedModType d R) (W : normedModType d' R). Lemma linear_boundedP (f : {linear V -> W}) : bounded_near f (nbhs 0) <-> \forall r \near +oo, forall x, `|f x| <= r * `|x|. @@ -2013,10 +2027,10 @@ split=> [|/pinfty_ex_gt0 [r r0 Bf]]; last first. apply/ex_bound; exists r; apply/nbhs_norm0P; exists 1 => //= x /=. by rewrite -(gtr_pMr _ r0) => /ltW; exact/le_trans/Bf. rewrite /bounded_near => /pinfty_ex_gt0 [M M0 /nbhs_norm0P [_/posnumP[e] efM]]. -near (0 : R)^'+ => d; near=> r => x. +near (0 : R)^'+ => e'; near=> r => x. have[->|x0] := eqVneq x 0; first by rewrite raddf0 !normr0 mulr0. -have nd0 : d / `|x| > 0 by rewrite divr_gt0 ?normr_gt0. -have: `|f (d / `|x| *: x)| <= M. +have nd0 : e' / `|x| > 0 by rewrite divr_gt0 ?normr_gt0. +have: `|f (e' / `|x| *: x)| <= M. by apply: efM => /=; rewrite normrZ gtr0_norm// divfK ?normr_eq0//. rewrite linearZ/= normrZ gtr0_norm// -ler_pdivlMl//; move/le_trans; apply. rewrite invfM invrK mulrAC ler_wpM2r//; near: r; apply: nbhs_pinfty_ge. @@ -2036,7 +2050,7 @@ Lemma bounded_linear_continuous (f : {linear V -> W}) : bounded_near f (nbhs (0 : V)) -> continuous f. Proof. move=> /linear_boundedP [y [yreal fr]] x; near +oo_R => r. -apply/(@cvgrPdist_lt _ _ _ (nbhs x)) => e e_gt0; near=> z; rewrite -linearB. +apply/(@cvgrPdist_lt _ _ _ _ (nbhs x)) => e e_gt0; near=> z; rewrite -linearB. rewrite (le_lt_trans (fr r _ _))// -?ltr_pdivlMl//. by near: z; apply: cvgr_dist_lt => //; rewrite mulrC divr_gt0. Unshelve. all: by end_near. Qed. @@ -2063,7 +2077,8 @@ Unshelve. all: by end_near. Qed. End LinearContinuousBounded. Section contractions. -Context {R : numDomainType} {X Y : normedModType R} {U : set X} {V : set Y}. +Context {d d'} {R : numDomainType} + {X : normedModType d R} {Y : normedModType d' R} {U : set X} {V : set Y}. Definition contraction (q : {nonneg R}) (f : {fun U >-> V}) := q%:num < 1 /\ q%:num.-lipschitz_U f. @@ -2072,8 +2087,8 @@ Definition is_contraction (f : {fun U >-> V}) := exists q, contraction q f. End contractions. -Lemma contraction_fixpoint_unique {R : realDomainType} - {X : normedModType R} (U : set X) (f : {fun U >-> U}) (x y : X) : +Lemma contraction_fixpoint_unique {d} {R : realDomainType} + {X : normedModType d R} (U : set X) (f : {fun U >-> U}) (x y : X) : is_contraction f -> U x -> U y -> x = f x -> y = f y -> x = y. Proof. case => q [q1 ctrfq] Ux Uy fixx fixy; apply/subr0_eq/normr0_eq0/eqP. @@ -2087,7 +2102,7 @@ Section cvg_seq_bounded. Context {K : numFieldType}. Local Notation "'+oo'" := (@pinfty_nbhs K). -Lemma cvg_seq_bounded {V : normedModType K} (a : nat -> V) : +Lemma cvg_seq_bounded {d} {V : normedModType d K} (a : nat -> V) : cvgn a -> bounded_fun a. Proof. move=> /cvg_bounded/ex_bound => -[/= Moo] => -[N _ /(_ _) aM]. @@ -2109,16 +2124,16 @@ Qed. Section Closed_Ball_normedModType. -Lemma closed_closed_ball_ (R : realFieldType) (V : normedModType R) +Lemma closed_closed_ball_ d (R : realFieldType) (V : normedModType d R) (x : V) (e : R) : closed (closed_ball_ normr x e). Proof. rewrite /closed_ball_ -/((normr \o (fun y => x - y)) @^-1` [set x | x <= e]). apply: (preimage_closed _ (@closed_le _ _)) => y _. -apply: (continuous_comp _ (@norm_continuous _ _ _)). -exact: (continuousB (@cst_continuous _ _ _ _)). +apply: (continuous_comp _ (@norm_continuous _ _ _ _)). +exact: (continuousB (@cst_continuous _ _ _ _ _ _)). Qed. -Lemma closed_ballE (R : realFieldType) (V : normedModType R) (x : V) +Lemma closed_ballE d (R : realFieldType) (V : normedModType d R) (x : V) (r : R) : 0 < r -> closed_ball x r = closed_ball_ normr x r. Proof. move=> /posnumP[e]; rewrite eqEsubset; split => y. @@ -2164,19 +2179,19 @@ move=> e_gt0; have : compact `[x - e, x + e] by apply: segment_compact. by rewrite closed_ballE//; under eq_set do rewrite in_itv -ler_distlC. Qed. -Lemma closed_ball_subset (R : realFieldType) (M : normedModType R) (x : M) +Lemma closed_ball_subset d (R : realFieldType) (M : normedModType d R) (x : M) (r0 r1 : R) : 0 < r0 -> r0 < r1 -> closed_ball x r0 `<=` ball x r1. Proof. move=> r00 r01; rewrite (_ : r0 = (PosNum r00)%:num) // closed_ballE //. by move=> m xm; rewrite -ball_normE /ball_ /= (le_lt_trans _ r01). Qed. -Lemma nbhs_closedballP (R : realFieldType) (M : normedModType R) (B : set M) +Lemma nbhs_closedballP d (R : realFieldType) (M : normedModType d R) (B : set M) (x : M) : nbhs x B <-> exists r : {posnum R}, closed_ball x r%:num `<=` B. Proof. split=> [/nbhs_ballP[_/posnumP[r] xrB]|[e xeB]]; last first. apply/nbhs_ballP; exists e%:num => //=. - exact: (subset_trans (@subset_closure _ _) xeB). + exact: (subset_trans (@subset_closure _ _ _) xeB). exists (r%:num / 2)%:itv. apply: (subset_trans (closed_ball_subset _ _) xrB) => //=. by rewrite lter_pdivrMr // ltr_pMr // ltr1n. @@ -2193,7 +2208,7 @@ rewrite itv_center_shift// -ball_itv closure_ballE itv_center_shift//. by rewrite closed_ball_itv// divr_gt0// subr_gt0. Qed. -Lemma open_subball {R : numFieldType} {M : normedModType R} (A : set M) +Lemma open_subball {d} {R : numFieldType} {M : normedModType d R} (A : set M) (x : M) : open A -> A x -> \forall e \near 0^'+, ball x e `<=` A. Proof. move=> oA Ax; have /nbhsr0P/= : nbhs x A by exact/open_nbhs_nbhs. @@ -2280,8 +2295,9 @@ Qed. End countable_isolated. -Lemma closed_disjoint_closed_ball {R : realFieldType} {M : normedModType R} - (K : set M) z : closed K -> ~ K z -> +Lemma closed_disjoint_closed_ball {d} {R : realFieldType} + {M : normedModType d R} (K : set M) z : + closed K -> ~ K z -> \forall d \near 0^'+, closed_ball z d `&` K = set0. Proof. rewrite -openC => /open_subball /[apply]; move=> [e /= e0]. @@ -2293,7 +2309,7 @@ move=> x /= + x0; rewrite sub0r normrN gtr0_norm// => xe. by move: ze2K0; apply: subsetI_eq0 => //=; exact: closed_ball_subset. Qed. -Lemma interior_closed_ballE (R : realType) (V : normedModType R) (x : V) +Lemma interior_closed_ballE d (R : realType) (V : normedModType d R) (x : V) (r : R) : 0 < r -> (closed_ball x r)° = ball x r. Proof. move=> r0; rewrite eqEsubset; split; last first. @@ -2310,7 +2326,7 @@ apply lt_le_trans; rewrite ltr_pMl; first by rewrite normr_gt0 subr_eq0 eq_sym. by rewrite ger0_norm // ltrDl normr_gt0; near: e; exists 1 => /=. Unshelve. all: by end_near. Qed. -Lemma open_nbhs_closed_ball (R : realType) (V : normedModType R) (x : V) +Lemma open_nbhs_closed_ball d (R : realType) (V : normedModType d R) (x : V) (r : R) : 0 < r -> open_nbhs x (closed_ball x r)°. Proof. move=> r0; split; first exact: open_interior. @@ -2657,21 +2673,21 @@ HB.instance Definition _ (V : vectType R) := PseudoMetric.copy (max_space V) (pseudoMetric_normed (max_space V)). HB.instance Definition _ (V : vectType R) := - NormedZmod_PseudoMetric_eq.Build R (max_space V) erefl. + NormedZmod_PseudoMetric_eq.Build _ R (max_space V) erefl. HB.instance Definition _ (V : vectType R) := - isPseudoMetricNormedZmodule.Build _ (max_space V). + isPseudoMetricNormedZmodule.Build _ _ (max_space V). HB.instance Definition _ (V : vectType R) := - PreUniformNmodule_isUniformNmodule.Build (max_space V) - (@PseudoMetricNormedZmodule_add_unif_continuous _ (max_space V)). + PreUniformNmodule_isUniformNmodule.Build _ (max_space V) + (@PseudoMetricNormedZmodule_add_unif_continuous _ _ (max_space V)). HB.instance Definition _ (V : vectType R) := - UniformNmodule_isUniformZmodule.Build (max_space V) - (@PseudoMetricNormedZmodule_opp_unif_continuous _ (max_space V)). + UniformNmodule_isUniformZmodule.Build _ (max_space V) + (@PseudoMetricNormedZmodule_opp_unif_continuous _ _ (max_space V)). HB.instance Definition _ (V : vectType R) := - PseudoMetricNormedZmod_Lmodule_isNormedModule.Build R (max_space V) + PseudoMetricNormedZmod_Lmodule_isNormedModule.Build _ R (max_space V) (@Norm.normZ _ _ (@max_norm V)). (* NB: Get Trocq to prove the continuity part automatically. *) @@ -2693,10 +2709,10 @@ have -> : [set x : max_space V | `|x| <= 1] = by move=> i; rewrite in_itv/= -ler_norml (le_trans _ x1) ?le_coord_max_norm. - rewrite /normr/= /max_norm bigmax_le => //= i _. by rewrite coord_sum_free ?ler_norml; [exact/basis_free/vbasisP|exact: X1]. -apply: (@continuous_compact _ _ (f : _ -> max_space V)). +apply: (@continuous_compact _ _ _ _ (f : _ -> max_space V)). - apply/continuous_subspaceT/sum_continuous => /= i _ x. - exact/continuousZr_tmp/proj_continuous. -- apply: (@tychonoff 'I_(\dim (@fullv _ V)) (fun=> R^o) + exact/continuousZr_tmp/(proj_continuous (i := i)). +- apply: (@tychonoff 'I_(\dim (@fullv _ V)) _ (fun=> R^o) (fun=> `[-1, 1]%classic)) => _. exact: segment_compact. Qed. @@ -2734,14 +2750,14 @@ have NC0 : continuous (N : max_space V -> R). by near: y; apply: cvgr_dist_le; [exact: cvg_id|exact: divr_gt0]. have: compact [set x : max_space V | `|x| = 1]. apply: (subclosed_compact _ (@sup_closed_ball_compact V)). - - apply: (@preimage_closed _ _ _ [set 1 : R]); last exact: closed_eq. + - apply: (@preimage_closed _ _ _ _ _ [set 1 : R]); last exact: closed_eq. by move=> *; exact: norm_continuous. - by move => x/=; rewrite closed_ballE// /closed_ball_/= sub0r normrN => ->. -move=> /(@continuous_compact _ _ (N : max_space V -> R)) -/(_ _)/wrap[]. +move=> /(@continuous_compact _ _ _ _ (N : max_space V -> R)) -/(_ _)/wrap[]. exact: continuous_subspaceT. -move=> /(@continuous_compact _ _ (@GRing.inv R)) -/(_ _)/wrap[]. +move=> /(@continuous_compact _ _ _ _ (@GRing.inv R)) -/(_ _)/wrap[]. move=> /= x; rewrite /continuous_at. - apply: (@continuous_in_subspaceT _ _ + apply: (@continuous_in_subspaceT _ _ _ _ [set N x | x in [set x : max_space V | `|x| = 1]] (@GRing.inv R)). move=> /= r /set_mem/= [y y1 <-]. apply: inv_continuous. @@ -2765,7 +2781,8 @@ rewrite ler_pdivrMr// => /le_trans; apply. by rewrite ler_pM2r// le_max lexx orbT. Unshelve. all: by end_near. Qed. -Lemma linear_findim_continuous (V : normedVectType R) (W : normedModType R) +Lemma linear_findim_continuous d d' + (V : normedVectType d R) (W : normedModType d' R) (f : {linear V -> W}) : continuous f. Proof. set V' := @fullv _ V. diff --git a/theories/normedtype_theory/num_normedtype.v b/theories/normedtype_theory/num_normedtype.v index ea6cadd6df..9cff6e8bbd 100644 --- a/theories/normedtype_theory/num_normedtype.v +++ b/theories/normedtype_theory/num_normedtype.v @@ -168,7 +168,7 @@ by apply/seteqP; split=> [?|?]; rewrite /ball/= sub0r normrN in_itv/= ltr_norml. Qed. Section nbhs_pseudoMetricType. -Context {R : numDomainType} {T : pseudoMetricType R}. +Context {d} {R : numDomainType} {T : pseudoMetricType d R}. Lemma ex_ball_sig (x : T) (P : set T) : ~ (forall eps : {posnum R}, ~ (ball x eps%:num `<=` ~` P)) -> @@ -599,7 +599,7 @@ Proof. by move=> fy; under eq_fun do rewrite mulrC; exact: lt0_cvgMly. Qed. End lt0_cvg. -Lemma cvgNy_compNP {T : topologicalType} {R : numFieldType} (f : R -> T) +Lemma cvgNy_compNP {d} {T : topologicalType d} {R : numFieldType} (f : R -> T) (l : set_system T) : f x @[x --> -oo] --> l <-> (f \o -%R) x @[x --> +oo] --> l. Proof. @@ -607,7 +607,7 @@ have f_opp : f =1 (fun x => (f \o -%R) (- x)) by move=> x; rewrite /comp opprK. by rewrite (eq_cvg -oo _ f_opp) [in X in X <-> _]fmap_comp ninftyN. Qed. -Lemma cvgy_compNP {T : topologicalType} {R : numFieldType} (f : R -> T) +Lemma cvgy_compNP {d} {T : topologicalType d} {R : numFieldType} (f : R -> T) (l : set_system T) : f x @[x --> +oo] --> l <-> (f \o -%R) x @[x --> -oo] --> l. Proof. @@ -1010,7 +1010,7 @@ Definition interior_itv := End interval_realType. Section continuous_within_itvP. -Context {R : realFieldType} {K : numDomainType} {U : pseudoMetricType K}. +Context {d} {R : realFieldType} {K : numDomainType} {U : pseudoMetricType d K}. Implicit Type f : R -> U. Let near_at_left (a : itv_bound R) b f eps : (a < BLeft b)%O -> 0 < eps -> @@ -1195,8 +1195,8 @@ End continuous_within_itvP. #[deprecated(since="analysis 1.19.0", note="Use continuous_within_itvccP instead.")] Notation continuous_within_itvP := continuous_within_itvccP (only parsing). -Lemma within_continuous_continuous {R : realFieldType} {K : numDomainType} - {U : pseudoMetricType K} a b (ba bb : bool) (f : R -> U) x : (a <= b)%R -> +Lemma within_continuous_continuous {d} {R : realFieldType} {K : numDomainType} + {U : pseudoMetricType d K} a b (ba bb : bool) (f : R -> U) x : (a <= b)%R -> {within [set` Interval (BSide ba a) (BSide bb b)], continuous f} -> x \in `]a, b[%R -> {for x, continuous f}. Proof. diff --git a/theories/normedtype_theory/pseudometric_normed_Zmodule.v b/theories/normedtype_theory/pseudometric_normed_Zmodule.v index 77cc267fc2..c0027a0086 100644 --- a/theories/normedtype_theory/pseudometric_normed_Zmodule.v +++ b/theories/normedtype_theory/pseudometric_normed_Zmodule.v @@ -121,22 +121,23 @@ rewrite [in X in _ = Interval _ X]addrC subrKA -!mulr2n. by rewrite -(mulr_natr a) -(mulr_natr b) !mulfK. Qed. -HB.structure Definition NbhsNmodule := {M of Nbhs M & GRing.Nmodule M}. -HB.structure Definition NbhsZmodule := {M of Nbhs M & GRing.Zmodule M}. -HB.structure Definition PreTopologicalNmodule := - {M of Topological M & GRing.Nmodule M}. +HB.structure Definition NbhsNmodule d := {M of Nbhs d M & GRing.Nmodule M}. +HB.structure Definition NbhsZmodule d := {M of Nbhs d M & GRing.Zmodule M}. +HB.structure Definition PreTopologicalNmodule d := + {M of Topological d M & GRing.Nmodule M}. -HB.mixin Record PreTopologicalNmodule_isTopologicalNmodule M - & PreTopologicalNmodule M := { +HB.mixin Record PreTopologicalNmodule_isTopologicalNmodule d M + & PreTopologicalNmodule d M := { add_continuous : continuous (fun x : M * M => x.1 + x.2) ; }. #[short(type="topologicalNmodType")] -HB.structure Definition TopologicalNmodule := - {M of PreTopologicalNmodule M & PreTopologicalNmodule_isTopologicalNmodule M}. +HB.structure Definition TopologicalNmodule d := + {M of PreTopologicalNmodule d M & + PreTopologicalNmodule_isTopologicalNmodule d M}. Section TopologicalNmodule_theory. -Context {E : Type} {F : topologicalNmodType} (U : set_system E). +Context {d} {E : Type} {F : topologicalNmodType d} (U : set_system E). Lemma cvg_sum (I : Type) (r : seq I) (P : pred I) (Ff : I -> E -> F) (Fa : I -> F) : @@ -147,14 +148,14 @@ Proof. by move=> FF Ffa; apply: cvg_big => //; exact: add_continuous. Qed. Lemma continuous_shift (x y : F) : {for x, continuous (+%R^~ y)}. Proof. have -> : +%R^~ y = (fun z => z.1 + z.2) \o (fun z => (z, y)) by exact: funext. -apply: continuous_comp (@add_continuous _ (x, y)). +apply: continuous_comp (@add_continuous _ _ (x, y)). by apply: cvg_pair => //=; exact: cvg_cst. Qed. End TopologicalNmodule_theory. Section TopologicalNmodule_theory. -Context {E : topologicalType} {F : topologicalNmodType}. +Context {d d'} {E : topologicalType d} {F : topologicalNmodType d'}. Lemma sum_continuous (I : Type) (r : seq I) (P : pred I) (f : I -> E -> F) : (forall i, P i -> continuous (f i)) -> @@ -164,7 +165,7 @@ Proof. by move=> FC0; apply: continuous_big => //; exact: add_continuous. Qed. End TopologicalNmodule_theory. Section cvg_composition_topologicalNmodType. -Context {T : Type} {V : topologicalNmodType} (F : set_system T) +Context {d} {T : Type} {V : topologicalNmodType d} (F : set_system T) {FF : Filter F}. Implicit Types (f g : T -> V) (a b : V). @@ -184,7 +185,7 @@ End cvg_composition_topologicalNmodType. Notation fun_cvgD := cvgD (only parsing). Section within_continuous_topologicalNmodType. -Context {T : topologicalType} {V : topologicalNmodType} (A : set T). +Context {d d'} {T : topologicalType d} {V : topologicalNmodType d'} (A : set T). Implicit Types f g : T -> V. Lemma within_continuousD f g : @@ -194,11 +195,11 @@ Proof. by move=> cf cg x; apply: cvgD; [exact: cf|exact: cg]. Qed. End within_continuous_topologicalNmodType. -HB.structure Definition PreTopologicalZmodule := - {M of Topological M & GRing.Zmodule M}. +HB.structure Definition PreTopologicalZmodule d := + {M of Topological d M & GRing.Zmodule M}. Section PreTopologicalZmoduleTheory. -Context {M : PreTopologicalZmodule.type}. +Context {d} {M : PreTopologicalZmodule.type d}. Lemma nbhsB_subproof (U : set M) (f : continuous (fun x : M * M => x.1 + x.2)) (z x : M) : @@ -222,22 +223,22 @@ Unshelve. all: by end_near. Qed. End PreTopologicalZmoduleTheory. -HB.mixin Record TopologicalNmodule_isTopologicalZmodule M - & PreTopologicalZmodule M := { +HB.mixin Record TopologicalNmodule_isTopologicalZmodule d M + & PreTopologicalZmodule d M := { opp_continuous : continuous (-%R : M -> M) ; }. #[short(type="topologicalZmodType")] -HB.structure Definition TopologicalZmodule := - {M of TopologicalNmodule M & GRing.Zmodule M - & TopologicalNmodule_isTopologicalZmodule M}. +HB.structure Definition TopologicalZmodule d := + {M of TopologicalNmodule d M & GRing.Zmodule M + & TopologicalNmodule_isTopologicalZmodule d M}. Section TopologicalZmoduleTheory. -Context {M : topologicalZmodType}. +Context {d} {M : topologicalZmodType d}. Lemma sub_continuous : continuous (fun x : M * M => x.1 - x.2). Proof. -move=> x; apply: (@continuous_comp _ _ _ (fun x => (x.1, - x.2)) +move=> x; apply: (@continuous_comp _ _ _ _ _ _ (fun x => (x.1, - x.2)) (fun x : M * M => x.1 + x.2)); last exact: add_continuous. apply: cvg_pair; first exact: cvg_fst. by apply: continuous_comp; [exact: cvg_snd|exact: opp_continuous]. @@ -263,20 +264,21 @@ Qed. End TopologicalZmoduleTheory. -HB.factory Record PreTopologicalNmodule_isTopologicalZmodule M - & PreTopologicalZmodule M := { +HB.factory Record PreTopologicalNmodule_isTopologicalZmodule d M + & PreTopologicalZmodule d M := { sub_continuous : continuous (fun x : M * M => x.1 - x.2) ; }. -HB.builders Context M & PreTopologicalNmodule_isTopologicalZmodule M. +HB.builders Context d M & PreTopologicalNmodule_isTopologicalZmodule d M. Let opp_continuous : continuous (-%R : M -> M). Proof. move=> x; rewrite /continuous_at. rewrite -(@eq_cvg _ _ _ (fun x => 0 - x)); first by move=> y; exact: add0r. rewrite -[- x]add0r. -apply: (@continuous_comp _ _ _ (fun x => (0, x)) (fun x : M * M => x.1 - x.2)). - exact: cvg_pair. +apply: (continuous_comp + (f := fun x => (0, x)) (g := fun x : M * M => x.1 - x.2) +); first exact: cvg_pair. exact: sub_continuous. Qed. @@ -286,22 +288,22 @@ move=> x; rewrite /continuous_at. rewrite -(@eq_cvg _ _ _ (fun x => x.1 - (- x.2))). by move=> y; rewrite opprK. rewrite -[in x.1 + _](opprK x.2). -apply: (@continuous_comp _ _ _ (fun x => (x.1, - x.2)) (fun x => x.1 - x.2)). +apply: (continuous_comp (f := fun x => (x.1, - x.2)) (g := fun x => x.1 - x.2)). apply: cvg_pair; first exact: cvg_fst. by apply: continuous_comp; [exact: cvg_snd|exact: opp_continuous]. exact: sub_continuous. Qed. HB.instance Definition _ := - PreTopologicalNmodule_isTopologicalNmodule.Build M add_continuous. + PreTopologicalNmodule_isTopologicalNmodule.Build d M add_continuous. HB.instance Definition _ := - TopologicalNmodule_isTopologicalZmodule.Build M opp_continuous. + TopologicalNmodule_isTopologicalZmodule.Build d M opp_continuous. HB.end. Section cvg_composition_topologicalZmodType. -Context {T : Type} (V : topologicalZmodType) (F : set_system T) +Context {d} {T : Type} (V : topologicalZmodType d) (F : set_system T) {FF : Filter F}. Implicit Types (f g : T -> V) (a b : V). @@ -342,7 +344,7 @@ End cvg_composition_topologicalZmodType. Notation fun_cvgN := cvgN (only parsing). Section within_continuous_topologicalZmodType. -Context {T : topologicalType} {V : topologicalZmodType} (A : set T). +Context {d d'} {T : topologicalType d} {V : topologicalZmodType d'} (A : set T). Implicit Types f g : T -> V. Lemma within_continuousB f g : @@ -356,23 +358,24 @@ Proof. move=> cf x; apply: cvgN; exact: cf. Qed. End within_continuous_topologicalZmodType. -HB.structure Definition PreUniformNmodule := {M of Uniform M & GRing.Nmodule M}. +HB.structure Definition PreUniformNmodule d := + {M of Uniform d M & GRing.Nmodule M}. -HB.mixin Record PreUniformNmodule_isUniformNmodule M & PreUniformNmodule M := { +HB.mixin Record PreUniformNmodule_isUniformNmodule d M & PreUniformNmodule d M := { add_unif_continuous : unif_continuous (fun x : M * M => x.1 + x.2) }. -HB.structure Definition UniformNmodule := - {M of PreUniformNmodule M & PreUniformNmodule_isUniformNmodule M & TopologicalNmodule M}. +HB.structure Definition UniformNmodule d := + {M of PreUniformNmodule d M & PreUniformNmodule_isUniformNmodule d M & TopologicalNmodule d M}. Section prod_TopologicalNmodule. -Context {E F : topologicalNmodType}. +Context {d d'} {E : topologicalNmodType d} {F : topologicalNmodType d'}. Let prod_add_continuous : continuous (fun x : (E * F) * (E * F) => x.1 + x.2). Proof. move => [/= x y] /= U /= [[/= A B]] /= [xyA xyB] ABU. -have [/= A0 [A01 A02] A0A] := @add_continuous E (x.1, y.1) _ xyA. -have [/= B0 [B01 B02] B0B] := @add_continuous F (x.2, y.2) _ xyB. +have [/= A0 [A01 A02] A0A] := @add_continuous _ E (x.1, y.1) _ xyA. +have [/= B0 [B01 B02] B0B] := @add_continuous _ F (x.2, y.2) _ xyB. exists ([set x | A0.1 x.1 /\ B0.1 x.2], [set xy | A0.2 xy.1 /\ B0.2 xy.2]). by split; [exists (A0.1, B0.1)|exists (A0.2, B0.2)]. move => [[x1 y1][x2 y2]] /= [[? ?] [? ?]]. @@ -380,21 +383,21 @@ by apply: ABU; split; [exact: (A0A (x1, x2))|exact: (B0B (y1, y2))]. Qed. HB.instance Definition _ := PreTopologicalNmodule_isTopologicalNmodule.Build - (E * F)%type prod_add_continuous. + _ (E * F)%type prod_add_continuous. End prod_TopologicalNmodule. Section prod_UniformNmodule. -Context {E F : UniformNmodule.type}. +Context {d d'} {E : UniformNmodule.type d} {F : UniformNmodule.type d'}. Let prod_add_unif_continuous : unif_continuous (fun x : (E * F) * (E * F) => x.1 + x.2). Proof. move=> P /= /entourage_prod_exS[A [B [entA entB ABP]]]. have [/= A1 [A2 [entA1 entA2 A12]]] := - entourage_prod_exS (@add_unif_continuous _ _ entA). + entourage_prod_exS (@add_unif_continuous _ _ _ entA). have [/= B1 [B2 [entB1 entB2 B12]]] := - entourage_prod_exS (@add_unif_continuous _ _ entB). + entourage_prod_exS (@add_unif_continuous _ _ _ entB). have entAB1 := prod_entP entA1 entB1. have entAB2 := prod_entP entA2 entB2. pose AB1 := [set xy | A1 (xy.1.1, xy.2.1) /\ B1 (xy.1.2, xy.2.2)]. @@ -408,61 +411,62 @@ by apply: ABP => /=; split; Qed. HB.instance Definition _ := PreUniformNmodule_isUniformNmodule.Build - (E * F)%type prod_add_unif_continuous. + _ (E * F)%type prod_add_unif_continuous. End prod_UniformNmodule. -HB.structure Definition PreUniformZmodule := {M of Uniform M & GRing.Zmodule M}. +HB.structure Definition PreUniformZmodule d := + {M of Uniform d M & GRing.Zmodule M}. -HB.mixin Record UniformNmodule_isUniformZmodule M - & PreUniformZmodule M := { +HB.mixin Record UniformNmodule_isUniformZmodule d M + & PreUniformZmodule d M := { opp_unif_continuous : unif_continuous (-%R : M -> M) }. -HB.structure Definition UniformZmodule := - {M of UniformNmodule M & GRing.Zmodule M & UniformNmodule_isUniformZmodule M - & TopologicalZmodule M}. +HB.structure Definition UniformZmodule d := + {M of UniformNmodule d M & GRing.Zmodule M + & UniformNmodule_isUniformZmodule d M & TopologicalZmodule d M}. Section prod_TopologicalZmodule. -Context {E F : TopologicalZmodule.type}. +Context {d d'} {E : TopologicalZmodule.type d} {F : TopologicalZmodule.type d'}. Let prod_opp_continuous : continuous (-%R : E * F -> E * F). Proof. move => [/= x y] /= U /= [[/= A B]] /= [xA yB] ABU. -have Ax := @opp_continuous E x _ xA. -have By := @opp_continuous F y _ yB. +have Ax := @opp_continuous _ E x _ xA. +have By := @opp_continuous _ F y _ yB. exists (-%R @^-1` A, -%R @^-1` B) => //=. by move=> [a b] []/= ANa BNb; exact: ABU. Qed. HB.instance Definition _ := TopologicalNmodule_isTopologicalZmodule.Build - (E * F)%type prod_opp_continuous. + _ (E * F)%type prod_opp_continuous. End prod_TopologicalZmodule. Section prod_UniformZmodule. -Context {E F : UniformZmodule.type}. +Context {d d'} {E : UniformZmodule.type d} {F : UniformZmodule.type d'}. Lemma prod_opp_unif_continuous : unif_continuous (-%R : E * F -> E * F). Proof. move=> P /= /entourage_prod_exS[A [B [entA entB ABP]]]. -have entAN := @opp_unif_continuous _ _ entA. -have entBN := @opp_unif_continuous _ _ entB. +have entAN := @opp_unif_continuous _ _ _ entA. +have entBN := @opp_unif_continuous _ _ _ entB. apply: filterS (prod_entP entAN entBN) => -[[a1 a2] [b1 b2]] /= [A1 B2]. exact: (ABP ((- a1, - a2), (- b1, - b2))). Qed. HB.instance Definition _ := UniformNmodule_isUniformZmodule.Build - (E * F)%type prod_opp_unif_continuous. + _ (E * F)%type prod_opp_unif_continuous. End prod_UniformZmodule. -HB.factory Record PreUniformNmodule_isUniformZmodule M - & PreUniformZmodule M := { +HB.factory Record PreUniformNmodule_isUniformZmodule d M + & PreUniformZmodule d M := { sub_unif_continuous : unif_continuous (fun x : M * M => x.1 - x.2) }. -HB.builders Context M & PreUniformNmodule_isUniformZmodule M. +HB.builders Context d M & PreUniformNmodule_isUniformZmodule d M. Lemma opp_unif_continuous : unif_continuous (-%R : M -> M). Proof. @@ -500,10 +504,10 @@ Lemma add_continuous : continuous (fun x : M * M => x.1 + x.2). Proof. by apply: unif_continuous_continuous; exact: add_unif_continuous. Qed. HB.instance Definition _ := - PreTopologicalNmodule_isTopologicalNmodule.Build M add_continuous. + PreTopologicalNmodule_isTopologicalNmodule.Build _ M add_continuous. HB.instance Definition _ := - PreUniformNmodule_isUniformNmodule.Build M add_unif_continuous. + PreUniformNmodule_isUniformNmodule.Build _ M add_unif_continuous. Lemma opp_continuous : continuous (-%R : M -> M). Proof. @@ -512,15 +516,15 @@ exact: opp_unif_continuous. Qed. HB.instance Definition _ := - TopologicalNmodule_isTopologicalZmodule.Build M opp_continuous. + TopologicalNmodule_isTopologicalZmodule.Build _ M opp_continuous. HB.instance Definition _ := - UniformNmodule_isUniformZmodule.Build M opp_unif_continuous. + UniformNmodule_isUniformZmodule.Build _ M opp_unif_continuous. HB.end. Section UniformZmoduleTheory. -Context {M : UniformZmodule.type}. +Context {d} {M : UniformZmodule.type d}. Lemma sub_unif_continuous : unif_continuous (fun x : M * M => x.1 - x.2). Proof. @@ -539,27 +543,27 @@ Qed. End UniformZmoduleTheory. -HB.mixin Record NormedZmod_PseudoMetric_eq (R : numDomainType) T - & Num.NormedZmodule R T & PseudoPointedMetric R T := { +HB.mixin Record NormedZmod_PseudoMetric_eq d (R : numDomainType) T + & Num.NormedZmodule R T & PseudoPointedMetric d R T := { pseudo_metric_ball_norm : ball = ball_ (fun x : T => `| x |) }. (* TODO: introduce #[short(type="pseudoMetricNormedZmodType")] after MCA 1.20.0 *) -HB.structure Definition PseudoMetricNormedZmodule (R : numDomainType) := - {T of Num.NormedZmodule R T & PseudoPointedMetric R T - & NormedZmod_PseudoMetric_eq R T }. +HB.structure Definition PseudoMetricNormedZmodule d (R : numDomainType) := + {T of Num.NormedZmodule R T & PseudoPointedMetric d R T + & NormedZmod_PseudoMetric_eq d R T }. #[deprecated(since="mathcomp-analysis 1.19.0", use=PseudoMetricNormedZmodule)] -Notation PseudoMetricNormedZmod0 x1 x2 := (PseudoMetricNormedZmodule x1 x2) (only parsing). +Notation PseudoMetricNormedZmod0 x1 x2 := (PseudoMetricNormedZmodule _ x1 x2) (only parsing). Module PseudoMetricNormedZmod0. #[deprecated(since="mathcomp-analysis 1.19.0", use=PseudoMetricNormedZmodule.type)] -Notation type x1 := (PseudoMetricNormedZmodule.type x1) (only parsing). +Notation type x1 := (PseudoMetricNormedZmodule.type _ x1) (only parsing). End PseudoMetricNormedZmod0. Section PseudoMetricNormedZmodule_numDomainType. -Context {K : numDomainType} {V : PseudoMetricNormedZmodule.type K}. +Context {d} {K : numDomainType} {V : PseudoMetricNormedZmodule.type d K}. (**md Balls defined by the norm: *) Local Notation ball_norm := (ball_ (@Num.norm K V)). @@ -570,7 +574,7 @@ Proof. by rewrite pseudo_metric_ball_norm. Qed. End PseudoMetricNormedZmodule_numDomainType. Section PseudoMetricNormedZmodule_numDomainType. -Context {K : numDomainType} {V : PseudoMetricNormedZmodule.type K}. +Context {d} {K : numDomainType} {V : PseudoMetricNormedZmodule.type d K}. Lemma ball_open (x : V) (r : K) : open (ball x r). Proof. @@ -598,7 +602,7 @@ Lemma nbhs_normP x (P : V -> Prop) : (\forall x0 \near x, P x0) <-> nbhs_norm x P. Proof. by rewrite nbhs_nbhs_norm. Qed. -Lemma nbhs_le_nbhs_norm (x : V) : @nbhs V _ x `=>` nbhs_norm x. +Lemma nbhs_le_nbhs_norm (x : V) : @nbhs _ V _ x `=>` nbhs_norm x. Proof. by move=> P [e e0 subP]; apply/nbhs_normP; exists e. Qed. Lemma nbhs_norm_le_nbhs x : nbhs_norm x `=>` nbhs x. @@ -743,12 +747,12 @@ Qed. End PseudoMetricNormedZmodule_numDomainType. #[global] Hint Resolve normr_ge0 : core. -Arguments cvgr_dist_lt {_ _ _ F FF}. -Arguments cvgr_distC_lt {_ _ _ F FF}. -Arguments cvgr_dist_le {_ _ _ F FF}. -Arguments cvgr_distC_le {_ _ _ F FF}. -Arguments cvgr0_norm_lt {_ _ _ F FF}. -Arguments cvgr0_norm_le {_ _ _ F FF}. +Arguments cvgr_dist_lt {_ _ _ _ F FF}. +Arguments cvgr_distC_lt {_ _ _ _ F FF}. +Arguments cvgr_dist_le {_ _ _ _ F FF}. +Arguments cvgr_distC_le {_ _ _ _ F FF}. +Arguments cvgr0_norm_lt {_ _ _ _ F FF}. +Arguments cvgr0_norm_le {_ _ _ _ F FF}. #[global] Hint Extern 0 (is_true (`|_ - ?x| < _)) => match goal with H : x \is_near _ |- _ => solve[near: x; now apply: cvgr_dist_lt] end : core. @@ -764,7 +768,7 @@ Arguments cvgr0_norm_le {_ _ _ F FF}. H : x \is_near _ |- _ => solve[near: x; now apply: cvgr0_norm_le] end : core. Section PseudoMetricNormedZmodule_realDomainType. -Context {R : realDomainType} {V : PseudoMetricNormedZmodule.type R}. +Context {d} {R : realDomainType} {V : PseudoMetricNormedZmodule.type d R}. Lemma le0_ball0 (a : V) (r : R) : r <= 0 -> ball a r = set0. Proof. @@ -781,7 +785,7 @@ Qed. End PseudoMetricNormedZmodule_realDomainType. Section PseudoMetricNormedZmodule_numFieldType. -Context {R : numFieldType} {V : PseudoMetricNormedZmodule.type R}. +Context {d} {R : numFieldType} {V : PseudoMetricNormedZmodule.type d R}. Lemma norm_hausdorff : hausdorff_space V. Proof. @@ -807,11 +811,12 @@ Lemma norm_cvg_unique {F} {FF : ProperFilter F} : is_subset1 [set x : V | F --> x]. Proof. exact: cvg_unique. Qed. -Lemma norm_cvg_eq (x y : V) : x --> y -> x = y. Proof. exact: (@cvg_eq V). Qed. +Lemma norm_cvg_eq (x y : V) : x --> y -> x = y. +Proof. exact: (@cvg_eq _ V). Qed. Lemma norm_lim_id (x : V) : lim (nbhs x) = x. Proof. exact: lim_id. Qed. Lemma norm_cvg_lim {F} {FF : ProperFilter F} (l : V) : F --> l -> lim F = l. -Proof. exact: (@cvg_lim V). Qed. +Proof. exact: (@cvg_lim _ V). Qed. Lemma norm_lim_near_cst U {F} {FF : ProperFilter F} (l : V) (f : U -> V) : (\forall x \near F, f x = l) -> lim (f @ F) = l. @@ -832,15 +837,15 @@ Proof. exact: cvgi_lim. Qed. Lemma distm_lt_split (z x y : V) (e : R) : `|x - z| < e / 2 -> `|z - y| < e / 2 -> `|x - y| < e. -Proof. by have := @ball_split _ _ z x y e; rewrite -ball_normE. Qed. +Proof. by have := @ball_split _ _ _ z x y e; rewrite -ball_normE. Qed. Lemma distm_lt_splitr (z x y : V) (e : R) : `|z - x| < e / 2 -> `|z - y| < e / 2 -> `|x - y| < e. -Proof. by have := @ball_splitr _ _ z x y e; rewrite -ball_normE. Qed. +Proof. by have := @ball_splitr _ _ _ z x y e; rewrite -ball_normE. Qed. Lemma distm_lt_splitl (z x y : V) (e : R) : `|x - z| < e / 2 -> `|y - z| < e / 2 -> `|x - y| < e. -Proof. by have := @ball_splitl _ _ z x y e; rewrite -ball_normE. Qed. +Proof. by have := @ball_splitl _ _ _ z x y e; rewrite -ball_normE. Qed. Lemma normm_leW (x : V) (e : R) : e > 0 -> `|x| <= e / 2 -> `|x| < e. Proof. @@ -878,19 +883,19 @@ End PseudoMetricNormedZmodule_numFieldType. Hint Extern 0 (hausdorff_space _) => solve[apply: norm_hausdorff] : core. #[short(type="metricNormedZmodType")] -HB.structure Definition MetricNormedZmodule (R : numDomainType) := - {T of PseudoMetricNormedZmodule R T & Metric R T & UniformZmodule T}. +HB.structure Definition MetricNormedZmodule d (R : numDomainType) := + {T of PseudoMetricNormedZmodule d R T & Metric d R T & UniformZmodule d T}. #[deprecated(since="mathcomp-analysis 1.19.0", use=MetricNormedZmodule)] -Notation PseudoMetricNormedZmod R := (MetricNormedZmodule R) (only parsing). +Notation PseudoMetricNormedZmod R := (MetricNormedZmodule _ R) (only parsing). #[deprecated(since="mathcomp-analysis 1.19.0", use=metricNormedZmodType)] Notation pseudoMetricNormedZmodType := metricNormedZmodType (only parsing). HB.factory Record isPseudoMetricNormedZmodule - (K : numFieldType) T & PseudoMetricNormedZmodule K T := { }. + d (K : numFieldType) T & PseudoMetricNormedZmodule d K T := { }. -HB.builders Context K T & isPseudoMetricNormedZmodule K T. +HB.builders Context d K T & isPseudoMetricNormedZmodule d K T. Let mdist (x y : T) : K := `|x - y|. @@ -899,11 +904,11 @@ Let mdist_ge0 x y : 0 <= mdist x y. Proof. by rewrite /mdist. Qed. Let mdist_positivity x y : mdist x y = 0 -> x = y. Proof. by move=> /normr0_eq0/subr0_eq. Qed. -Let ballEmdist x d : ball x d = [set y | mdist x y < d]. +Let ballEmdist x e : ball x e = [set y | mdist x y < e]. Proof. by rewrite -ball_normE. Qed. -HB.instance Definition _ := - @PseudoMetric_isMetric.Build K T mdist mdist_ge0 mdist_positivity ballEmdist. +HB.instance Definition _ := @PseudoMetric_isMetric.Build _ K T + mdist mdist_ge0 mdist_positivity ballEmdist. Let add_continuous : continuous (fun x : T * T => x.1 + x.2). Proof. @@ -913,7 +918,7 @@ by rewrite opprD addrACA normm_lt_split. Unshelve. all: by end_near. Qed. HB.instance Definition _ := - PreTopologicalNmodule_isTopologicalNmodule.Build T add_continuous. + PreTopologicalNmodule_isTopologicalNmodule.Build _ T add_continuous. Let opp_continuous : continuous (-%R : T -> T). Proof. @@ -923,31 +928,32 @@ by rewrite opprK addrC. Unshelve. all: by end_near. Qed. HB.instance Definition _ := - TopologicalNmodule_isTopologicalZmodule.Build T opp_continuous. + TopologicalNmodule_isTopologicalZmodule.Build _ T opp_continuous. HB.end. (* alternative definition of a MetricNormedZmod *) -HB.factory Record NormedZmoduleMetric (R : numDomainType) T - & Num.NormedZmodule R T & Metric R T & isPointed T := { +HB.factory Record NormedZmoduleMetric d (R : numDomainType) T + & Num.NormedZmodule R T & Metric d R T & isPointed T := { mdist_norm : forall x y : T, mdist x y = `|y - x| }. -HB.builders Context (R : numDomainType) T & NormedZmoduleMetric R T. +HB.builders Context d (R : numDomainType) T & NormedZmoduleMetric d R T. Let pseudo_metric_ball_norm : ball = ball_ (fun x : T => `| x |). Proof. -apply/funext => /= t; apply/funext => d; rewrite ballEmdist. +apply/funext => /= t; apply/funext => e; rewrite ballEmdist. by apply/seteqP; split => [y|y]/=; rewrite mdist_norm distrC. Qed. HB.instance Definition _ := - NormedZmod_PseudoMetric_eq.Build R T pseudo_metric_ball_norm. + NormedZmod_PseudoMetric_eq.Build _ R T pseudo_metric_ball_norm. HB.end. Section prod_pseudoMetricNormedZmod. -Context {K : numDomainType} {U V : metricNormedZmodType K}. +Context {d d' : fdisp_t} {K : numDomainType}. +Context {U : metricNormedZmodType d K} {V : metricNormedZmodType d' K}. Lemma ball_prod_normE : ball = ball_ (fun x => `| x : U * V |). Proof. @@ -956,16 +962,17 @@ rewrite /ball /= /prod_ball -!ball_normE /ball_ /=. by rewrite comparable_gt_max// ?real_comparable//; split=> /andP. Qed. -Let prod_norm_ball : @ball _ (U * V)%type = ball_ (fun x => `|x|). +Let prod_norm_ball : @ball _ _ (U * V)%type = ball_ (fun x => `|x|). Proof. by rewrite /= - ball_prod_normE. Qed. -HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build K (U * V)%type - prod_norm_ball. +HB.instance Definition _ := + NormedZmod_PseudoMetric_eq.Build _ K (U * V)%type prod_norm_ball. End prod_pseudoMetricNormedZmod. Section prod_NormedModule_lemmas. -Context {T : Type} {K : numDomainType} {U V : metricNormedZmodType K}. +Context {d d' : fdisp_t} {T : Type} {K : numDomainType}. +Context {U : metricNormedZmodType d K} {V : metricNormedZmodType d' K}. Lemma fcvgr2dist_ltP {F : set_system U} {G : set_system V} {FF : Filter F} {FG : Filter G} (y : U) (z : V) : @@ -992,15 +999,15 @@ Lemma cvgr2dist_lt {I J} {F : set_system I} {G : set_system J} Proof. by rewrite cvgr2dist_ltP. Qed. End prod_NormedModule_lemmas. -Arguments cvgr2dist_ltP {_ _ _ _ _ F G FF FG}. -Arguments cvgr2dist_lt {_ _ _ _ _ F G FF FG}. +Arguments cvgr2dist_ltP {_ _ _ _ _ _ _ F G FF FG}. +Arguments cvgr2dist_lt {_ _ _ _ _ _ _ F G FF FG}. Section standard_topology_pseudoMetricNormedZmod. Context {R : numFieldType}. HB.instance Definition _ := Num.NormedZmodule.on R^o. -HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build R R^o erefl. +HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build _ R R^o erefl. Let standard_add_continuous : continuous (fun x : R^o * R^o => x.1 + x.2). Proof. @@ -1009,10 +1016,10 @@ exact: PseudoMetricNormedZmodule_add_unif_continuous. Qed. HB.instance Definition _ := PreTopologicalNmodule_isTopologicalNmodule.Build - R^o standard_add_continuous. + _ R^o standard_add_continuous. HB.instance Definition _ := PreUniformNmodule_isUniformNmodule.Build - R^o (@PseudoMetricNormedZmodule_add_unif_continuous R^o R^o). + _ R^o (@PseudoMetricNormedZmodule_add_unif_continuous _ R^o R^o). Let standard_opp_continuous : continuous (-%R : R^o -> R^o). Proof. @@ -1021,23 +1028,23 @@ exact: PseudoMetricNormedZmodule_opp_unif_continuous. Qed. HB.instance Definition _ := TopologicalNmodule_isTopologicalZmodule.Build - R^o standard_opp_continuous. + _ R^o standard_opp_continuous. HB.instance Definition _ := UniformNmodule_isUniformZmodule.Build - R^o (@PseudoMetricNormedZmodule_opp_unif_continuous R^o R^o). + _ R^o (@PseudoMetricNormedZmodule_opp_unif_continuous _ R^o R^o). End standard_topology_pseudoMetricNormedZmod. Lemma ball_itv {R : realFieldType} (x r : R) : ball x r = `]x - r, x + r[%classic. Proof. -rewrite -(@ball_normE _ R^o) /ball_ set_itvE. +rewrite -(@ball_normE _ _ R^o) /ball_ set_itvE. by apply/seteqP; split => t/=; rewrite ltr_distlC. Qed. (** Normed vector spaces have some continuous functions that are in fact continuous on metricNormedZmodType *) Section continuity_metricNormedZmodType. -Context {K : numFieldType} {V : metricNormedZmodType K}. +Context {d} {K : numFieldType} {V : metricNormedZmodType d K}. Lemma oppr_continuous : continuous (@GRing.opp V). Proof. @@ -1054,7 +1061,7 @@ Unshelve. all: by end_near. Qed. Lemma norm_continuous : continuous (Num.norm : V -> K). Proof. -move=> x; apply/(@cvgrPdist_lt K K^o) => e e0; apply/nbhs_normP. +move=> x; apply/(@cvgrPdist_lt _ K K^o) => e e0; apply/nbhs_normP. by exists e => //= y; exact/le_lt_trans/ler_dist_dist. Qed. @@ -1068,7 +1075,7 @@ Context {R : numFieldType}. Lemma nbhs_right0P x (P : set R) : (\forall y \near x^'+, P y) <-> \forall e \near 0^'+, P (x + e). Proof. -rewrite !near_withinE -[X in X <-> _]nearE !near_simpl (@nbhs0P _ R^o). +rewrite !near_withinE -[X in X <-> _]nearE !near_simpl (@nbhs0P _ _ R^o). rewrite -propeqE. by apply: (@eq_near _ (nbhs (0 : R))) => y; rewrite ltrDl. Qed. @@ -1077,7 +1084,7 @@ Lemma nbhs_left0P x (P : set R) : (\forall y \near x^'-, P y) <-> \forall e \near 0^'+, P (x - e). Proof. rewrite !near_withinE -[X in X <-> _]nearE -[X in _ <-> X]nearE. -rewrite !near_simpl (@nbhs0P R R^o); split=> Px. +rewrite !near_simpl (@nbhs0P _ R R^o); split=> Px. suff: \forall x0 \near (0:R), 0 < x0 -> P (x - x0) by []. rewrite -oppr0 nearN; near=> e; rewrite ltrN2 opprK => e_lt0. by apply: (near Px) => //; rewrite gtrDl. @@ -1140,14 +1147,14 @@ Qed. End at_left_right. -Lemma cvg_at_leftNP {T : topologicalType} {R : numFieldType} +Lemma cvg_at_leftNP {d} {T : topologicalType d} {R : numFieldType} (f : R -> T) a (l : T) : f @ a^'- --> l <-> f \o -%R @ (- a)^'+ --> l. Proof. by rewrite at_rightN -?fmap_comp; under [_ \o _]eq_fun => ? do rewrite /= opprK. Qed. -Lemma cvg_at_rightNP {T : topologicalType} {R : numFieldType} +Lemma cvg_at_rightNP {d} {T : topologicalType d} {R : numFieldType} (f : R -> T) a (l : T) : f @ a^'+ --> l <-> f \o -%R @ (- a)^'- --> l. Proof. @@ -1170,7 +1177,7 @@ by apply/nearW => /= y; rewrite addrC subrK. Qed. Section at_left_right_pseudoMetricNormedZmod. -Context {R : numFieldType} {V : PseudoMetricNormedZmodule.type R}. +Context {d} {R : numFieldType} {V : PseudoMetricNormedZmodule.type d R}. Lemma nbhsr0P (P : set V) x : (\forall y \near x, P y) <-> @@ -1179,11 +1186,11 @@ Proof. rewrite nbhs0P/= near_withinE/=. split. move => /nbhs_norm0P[/= _/posnumP[e] /(_ _) Px]. - apply/(@nbhs_norm0P R R^o). + apply/(@nbhs_norm0P _ R R^o). exists e%:num => //= r /= re yr y xyr; rewrite -[y](addrNK x) addrC. by apply: Px; rewrite /= distrC (le_lt_trans _ re)// gtr0_norm. -move => /(@nbhs_norm0P R R^o)[/= _/posnumP[e] /(_ _) Px]. -apply/(@nbhs_norm0P R V). +move => /(@nbhs_norm0P _ R R^o)[/= _/posnumP[e] /(_ _) Px]. +apply/(@nbhs_norm0P _ R V). exists (e%:num / 2) => //= r /= re; apply: (Px (e%:num / 2)) => //=. by rewrite gtr0_norm// ltr_pdivrMr// ltr_pMr// ltr1n. by rewrite opprD addNKr normrN ltW. @@ -1197,12 +1204,12 @@ Let cvgrP {F : set_system V} {FF : Filter F} (y : V) : [<-> Proof. tfae; first by move=> *; apply: cvgr_dist_le. - by move=> Fy; near do apply: Fy; apply: nbhs_right_gt. -- move=> Fy; near=> e; near (0:R)^'+ => d; near=> x. - rewrite (@le_lt_trans _ _ d)//; first by near: x; near: d. - by near: d; apply: nbhs_right_lt; near: e; apply: nbhs_right_gt. -- move=> Fy; apply/cvgrPdist_lt => e e_gt0; near (0:R)^'+ => d. - near=> x; rewrite (@lt_le_trans _ _ d)//; first by near: x; near: d. - by near: d; apply: nbhs_right_le. +- move=> Fy; near=> e; near (0:R)^'+ => e'; near=> x. + rewrite (@le_lt_trans _ _ e')//; first by near: x; near: e'. + by near: e'; apply: nbhs_right_lt; near: e; apply: nbhs_right_gt. +- move=> Fy; apply/cvgrPdist_lt => e e_gt0; near (0:R)^'+ => e'. + near=> x; rewrite (@lt_le_trans _ _ e')//; first by near: x; near: e'. + by near: e'; apply: nbhs_right_le. Unshelve. all: by end_near. Qed. Lemma cvgrPdist_le {T} {F : set_system T} {FF : Filter F} (f : T -> V) (y : V) : @@ -1296,11 +1303,11 @@ by apply: (@cvgr_norm_gt _ _ _ _ y); rewrite // normr_gt0. Unshelve. all: by end_near. Qed. End at_left_right_pseudoMetricNormedZmod. -Arguments cvgr_norm_lt {R V T F FF f}. -Arguments cvgr_norm_le {R V T F FF f}. -Arguments cvgr_norm_gt {R V T F FF f}. -Arguments cvgr_norm_ge {R V T F FF f}. -Arguments cvgr_neq0 {R V T F FF f}. +Arguments cvgr_norm_lt {d R V T F FF f}. +Arguments cvgr_norm_le {d R V T F FF f}. +Arguments cvgr_norm_gt {d R V T F FF f}. +Arguments cvgr_norm_ge {d R V T F FF f}. +Arguments cvgr_neq0 {d R V T F FF f}. #[global] Hint Extern 0 (is_true (_ < ?x)) => match goal with H : x \is_near _ |- _ => solve[near: x; now apply: nbhs_right_gt] end : core. @@ -1399,8 +1406,8 @@ by rewrite gtr_pMr// invf_lt1// ltr1n. Unshelve. all: by end_near. Qed. Section pseudoMetricNormedZmodule_numFieldType. -Context {R : numFieldType} {V : PseudoMetricNormedZmodule.type R} {I : Type} - (F : set_system I) (FF : Filter F) (f : I -> V) (y : V). +Context {d} {R : numFieldType} {V : PseudoMetricNormedZmodule.type d R} + {I : Type} (F : set_system I) (FF : Filter F) (f : I -> V) (y : V). Lemma cvgr_norm_lty : f @ F --> y -> \forall M \near +oo, \forall y' \near F, `|f y'| < M. @@ -1426,10 +1433,10 @@ by move=> Fy; near do exact: (cvgr_norm_ge y). Unshelve. all: by end_near. Qed. End pseudoMetricNormedZmodule_numFieldType. -Arguments cvgr_norm_lty {R V I F FF}. -Arguments cvgr_norm_ley {R V I F FF}. -Arguments cvgr_norm_gtNy {R V I F FF}. -Arguments cvgr_norm_geNy {R V I F FF}. +Arguments cvgr_norm_lty {d R V I F FF}. +Arguments cvgr_norm_ley {d R V I F FF}. +Arguments cvgr_norm_gtNy {d R V I F FF}. +Arguments cvgr_norm_geNy {d R V I F FF}. Section realFieldType. Context {R : realFieldType}. @@ -1438,7 +1445,7 @@ Lemma at_right_in_segment (x : R) (P : set R) : (\forall e \near 0^'+, {in `[x - e, x + e], forall x, P x}) <-> (\forall x0 \near x, P x0). Proof. -rewrite (@nbhsr0P _ R^o) -propeqE; apply: eq_near => y /=. +rewrite (@nbhsr0P _ _ R^o) -propeqE; apply: eq_near => y /=. by rewrite -propeqE; apply: eq_forall => z; rewrite ler_distlC. Qed. @@ -1455,7 +1462,7 @@ Ltac near_simpl := rewrite ?near_simpl. End NearNorm. Section cvg_composition_metricNormedZmodType. -Context {K : numFieldType} {V : metricNormedZmodType K} {T : Type} +Context {d} {K : numFieldType} {V : metricNormedZmodType d K} {T : Type} (F : set_system T) {FF : Filter F}. Implicit Types (f g : T -> V) (s : T -> K) (k : K) (x : T) (a b : V). @@ -1496,7 +1503,7 @@ Lemma norm_cvg0P f : `|f x| @[x --> F] --> (0:K^o) <-> f @ F --> 0. Proof. split; last by move=> /cvg_norm; rewrite normr0. move=> f0; apply/cvgr0Pnorm_lt => e e_gt0. -by near do rewrite -normr_id; apply: (@cvgr0_norm_lt _ K^o). +by near do rewrite -normr_id; apply: (@cvgr0_norm_lt _ _ K^o). Unshelve. all: by end_near. Qed. Lemma norm_cvg0 f : `|f x| @[x --> F] --> (0:K^o) -> f @ F --> 0. @@ -1505,7 +1512,7 @@ Proof. by rewrite norm_cvg0P. Qed. End cvg_composition_metricNormedZmodType. Section limit_composition_metricNormedZmodType. -Context {K : numFieldType} {V : metricNormedZmodType K} {T : Type} +Context {d} {K : numFieldType} {V : metricNormedZmodType d K} {T : Type} (F : set_system T) {FF : ProperFilter F}. Implicit Types (f g : T -> V) (s : T -> K) (k : K) (x : T) (a : V). @@ -1523,14 +1530,16 @@ Proof. by move=> ? ?; apply: cvg_lim => //; apply: cvgB. Qed. Lemma lim_norm f : cvg (f @ F) -> lim ((fun x => `|f x| : K) @ F) = `|lim (f @ F)|. Proof. move=> ?; apply: cvg_lim. - exact: (@norm_hausdorff K K^o). + exact: (@norm_hausdorff _ K K^o). exact: cvg_norm. Qed. End limit_composition_metricNormedZmodType. Section domination. -Context {T : Type} {K : numDomainType} {V W : PseudoMetricNormedZmodule.type K}. +Context {d d' : fdisp_t} {T : Type} {K : numDomainType}. +Context {V : PseudoMetricNormedZmodule.type d K} + {W : PseudoMetricNormedZmodule.type d' K}. Definition dominated_by (h : T -> V) (k : K) (f : T -> W) (F : set_system T) := F [set x | `|f x| <= k * `|h x|]. @@ -1545,14 +1554,17 @@ Proof. by move=> FG f; exact: FG. Qed. End domination. -Lemma sub_dominatedr (T : Type) (K : numDomainType) (V : metricNormedZmodType K) - (h : T -> V) (k : K) (f g : T -> V) (F : set_system T) (FF : Filter F) : +Lemma sub_dominatedr d (T : Type) (K : numDomainType) + (V : metricNormedZmodType d K) (h : T -> V) (k : K) (f g : T -> V) + (F : set_system T) (FF : Filter F) : (\forall x \near F, `|f x| <= `|g x|) -> dominated_by h k g F -> dominated_by h k f F. Proof. by move=> le_fg; apply: filterS2 le_fg => x; apply: le_trans. Qed. Section ex_dom_bound. -Context {T : Type} {K : numFieldType} {V W : PseudoMetricNormedZmodule.type K}. +Context {d d' : fdisp_t} {T : Type} {K : numFieldType}. +Context {V : PseudoMetricNormedZmodule.type d K} + {W : PseudoMetricNormedZmodule.type d' K}. Lemma ex_dom_bound (h : T -> V) (f : T -> W) (F : set_system T) {PF : ProperFilter F} : @@ -1586,8 +1598,8 @@ Qed. End ex_dom_bound. -Definition bounded_near {T : Type} {K : numFieldType} - {V : PseudoMetricNormedZmodule.type K} +Definition bounded_near {d} {T : Type} {K : numFieldType} + {V : PseudoMetricNormedZmodule.type d K} (f : T -> V) (F : set_system T) := \forall M \near +oo, F [set x | `|f x| <= M]. @@ -1600,10 +1612,10 @@ Definition fun1 {T : Type} {K : numFieldType} : T -> K^o := fun=> 1. Arguments fun1 {T K} x /. Section bounded_near. -Context {T : Type} {K : numFieldType} {V : metricNormedZmodType K}. +Context {d} {T : Type} {K : numFieldType} {V : metricNormedZmodType d K}. Lemma sub_boundedr (F G : set_system T) : F `=>` G -> - (@bounded_near T K V)^~ G `<=` bounded_near^~ F. + (@bounded_near _ T K V)^~ G `<=` bounded_near^~ F. Proof. by move=> FG f; rewrite /bounded_near; apply: filterS=> M; apply: FG. Qed. Lemma sub_boundedl (f g : T -> V) (F : set_system T) (FF : Filter F) : @@ -1621,18 +1633,20 @@ by apply: filterS FM => x /le_lt_trans/= ->//; rewrite ltrDl. Qed. Lemma dominated_by1 : - @dominated_by T K K^o V fun1 = fun k f F => F [set x | `|f x| <= k]. + @dominated_by _ _ T K K^o V fun1 = fun k f F => F [set x | `|f x| <= k]. Proof. rewrite funeq3E => k f F. by congr F; rewrite funeqE => x/=; rewrite normr1 mulr1. Qed. Lemma boundedE : - @bounded_near T K V = fun f F => \forall M \near +oo, dominated_by fun1 M f F. + @bounded_near _ T K V + = fun f F => \forall M \near +oo, dominated_by fun1 M f F. Proof. by rewrite dominated_by1. Qed. Lemma strictly_dominated_by1 : - @strictly_dominated_by T K K^o V fun1 = fun k f F => F [set x | `|f x| < k]. + @strictly_dominated_by _ _ T K K^o V fun1 + = fun k f F => F [set x | `|f x| < k]. Proof. rewrite funeq3E => k f F. by congr F; rewrite funeqE => x/=; rewrite normr1 mulr1. @@ -1651,7 +1665,7 @@ Unshelve. all: by end_near. Qed. End bounded_near. -Lemma compact_bounded {K : realFieldType} {V : metricNormedZmodType K} +Lemma compact_bounded {d} {K : realFieldType} {V : metricNormedZmodType d K} (A : set V) : compact A -> bounded_set A. Proof. @@ -1671,7 +1685,7 @@ have : i \in enum_fset I by []. by rewrite enum_fsetE => /mapP[/= j Ij ->] ; exact: le_bigmax. Qed. -Lemma bounded_image T (K : numFieldType) (V : metricNormedZmodType K) +Lemma bounded_image d T (K : numFieldType) (V : metricNormedZmodType d K) (f : T -> V) (A : set T) : [bounded f x | x in A] <-> bounded_set (f @` A). Proof. @@ -1680,22 +1694,22 @@ split; rewrite /bounded_set /bounded_near. - by apply: filterS => r /= + t At => /(_ (f t)); apply; exists t. Qed. -Lemma ub_bounded (K : realFieldType) (M : K) - (V : metricNormedZmodType K) T (f : T -> V) (A : set T) : +Lemma ub_bounded d (K : realFieldType) (M : K) + (V : metricNormedZmodType d K) T (f : T -> V) (A : set T) : (forall x, A x -> `|f x| <= M) -> [bounded f x | x in A]. Proof. rewrite /bounded_near => M_ub. by near=> r => /= t At; rewrite (le_trans (M_ub _ At)). Unshelve. all: by end_near. Qed. -Arguments ub_bounded {K} M. +Arguments ub_bounded {d K} M. -Lemma bounded_ex_gt0 T (K : realFieldType) (V : metricNormedZmodType K) +Lemma bounded_ex_gt0 d T (K : realFieldType) (V : metricNormedZmodType d K) (f : T -> V) (A : set T) : [bounded f x | x in A] -> exists2 M : K, M > 0 & forall x, A x -> `|f x| <= M. Proof. by rewrite /bounded_near; move/pinfty_ex_gt0. Qed. -Lemma bounded_setU T (K : realFieldType) (V : metricNormedZmodType K) +Lemma bounded_setU d T (K : realFieldType) (V : metricNormedZmodType d K) (f : T -> V) (A B : set T) : [bounded f x | x in A] -> [bounded f x | x in B] -> [bounded f x | x in A `|` B]. @@ -1706,27 +1720,27 @@ apply/(ub_bounded (MA + MB)) => x [Ax|Bx]. - by rewrite (le_trans (MB_ub _ Bx))// lerDr ltW. Qed. -Lemma bounded_set0 T (K : numFieldType) (V : metricNormedZmodType K) +Lemma bounded_set0 d T (K : numFieldType) (V : metricNormedZmodType d K) (f : T -> V) : [bounded f x | x in set0]. Proof. by near=> M => /=. Unshelve. all: by end_near. Qed. -Lemma bounded_set1 T (K : realFieldType) (V : metricNormedZmodType K) +Lemma bounded_set1 d T (K : realFieldType) (V : metricNormedZmodType d K) (f : T -> V) (x0 : T) : [bounded f x | x in [set x0]]. Proof. by apply: ub_bounded => ? ->. Qed. Hint Resolve bounded_set0 bounded_set1 : core. -Lemma boundedS T (B A : set T) (K : realFieldType) - (V : metricNormedZmodType K) (f : T -> V) : A `<=` B -> +Lemma boundedS d T (B A : set T) (K : realFieldType) + (V : metricNormedZmodType d K) (f : T -> V) : A `<=` B -> [bounded f x | x in B] -> [bounded f x | x in A]. Proof. by move=> AB /bounded_ex_gt0[M M0 Mub]; apply: ub_bounded => x /AB; exact: Mub. Qed. -Arguments boundedS {T} B. +Arguments boundedS {d T} B. -Lemma boundedD T (K : realFieldType) (V : metricNormedZmodType K) +Lemma boundedD d T (K : realFieldType) (V : metricNormedZmodType d K) (f g : T -> V) (A : set T) : [bounded f x | x in A] -> [bounded g x | x in A] -> [bounded f x + g x | x in A]. @@ -1736,8 +1750,9 @@ apply: ub_bounded => x Ax /=. by rewrite (le_trans (ler_normD _ _))//; apply: lerD; [exact:Mf_ub|exact:Mg_ub]. Qed. -Lemma bounded_itvbb d (T : orderType d) (K : realFieldType) - (V : metricNormedZmodType K) (f : T -> V) (a b : T) (b1 b2 b1' b2' : bool) : +Lemma bounded_itvbb td d (T : orderType d) (K : realFieldType) + (V : metricNormedZmodType td K) (f : T -> V) + (a b : T) (b1 b2 b1' b2' : bool) : [bounded f x | x in [set` Interval (BSide b1 a) (BSide b2 b)]] -> [bounded f x | x in [set` Interval (BSide b1' a) (BSide b2' b)]]. Proof. @@ -1748,7 +1763,7 @@ rewrite -(setUitv_set2 b1 b2)//. by apply/bounded_setU; last exact/bounded_setU. Qed. -Lemma eq_bounded T (K : numFieldType) (V : metricNormedZmodType K) +Lemma eq_bounded d T (K : numFieldType) (V : metricNormedZmodType d K) (f g : T -> V) (A : set T) : {in A, f =1 g} -> [bounded f x | x in A] = [bounded g x | x in A]. Proof. @@ -1756,14 +1771,14 @@ move=> fg; apply: eq_near => M; apply/propeqP; apply: eq_forall => x. by apply: eq_forall => Ax /=; rewrite fg ?inE. Qed. -Lemma continuous_compact_bounded (T : topologicalType) (K : realFieldType) - (V : metricNormedZmodType K) (A : set T) (f : T -> V) : +Lemma continuous_compact_bounded d d' (T : topologicalType d) + (K : realFieldType) (V : metricNormedZmodType d' K) (A : set T) (f : T -> V) : compact A -> {within A, continuous f} -> [bounded f x | x in A]. Proof. by move=> cA cf; exact/bounded_image/compact_bounded/continuous_compact. Qed. -Lemma bounded_comp T U (K : realFieldType) (V : metricNormedZmodType K) +Lemma bounded_comp d T U (K : realFieldType) (V : metricNormedZmodType d K) (f : T -> U) (g : U -> V) (E : set T) (F : set U) : f @` E `<=` F -> [bounded g y | y in F] -> [bounded g (f x) | x in E]. @@ -1772,8 +1787,8 @@ move=> rng_sub /bounded_ex_gt0[Mg Mg_gt0 Mg_ub]. by apply/ub_bounded => x Ex; exact/(Mg_ub (f x))/rng_sub. Qed. -Lemma bounded_center (T : numDomainType) (K : realFieldType) - (V : metricNormedZmodType K) (f : T -> V) (x y a : T) (b1 b2 : bool) : +Lemma bounded_center d (T : numDomainType) (K : realFieldType) + (V : metricNormedZmodType d K) (f : T -> V) (x y a : T) (b1 b2 : bool) : [bounded f z | z in [set` Interval (BSide b1 (x - a)) (BSide b2 (y - a))]] -> [bounded f ((*z - a*) center a z) | z in [set` Interval (BSide b1 x) (BSide b2 y)]]. Proof. @@ -1782,30 +1797,30 @@ by case: b1 b2 => [|] [|] /=; rewrite ?ltrD2r ?lerD2r. Qed. Section cvg_bounded. -Context {R : numFieldType} {V : PseudoMetricNormedZmodule.type R}. +Context {d} {R : numFieldType} {V : PseudoMetricNormedZmodule.type d R}. Lemma cvg_bounded {I} {F : set_system I} {FF : Filter F} (f : I -> V) (y : V) : f @ F --> y -> bounded_near f F. Proof. exact: cvgr_norm_ley. Qed. End cvg_bounded. -Arguments cvg_bounded {R V I F FF}. +Arguments cvg_bounded {d R V I F FF}. Lemma standard_scale_continuous {R : numFieldType} : continuous (fun z : R^o * R^o => z.1 *: z.2). Proof. move=> [/= k x]; apply/cvgrPdist_lt => _/posnumP[e]; near +oo_R => M. near=> l z => /=; have M0 : 0 < M by []. -rewrite (@distm_lt_split _ _ (k *: z)) // -?(scalerBr, scalerBl) normrM. +rewrite (@distm_lt_split _ _ _ (k *: z)) // -?(scalerBr, scalerBl) normrM. rewrite (@le_lt_trans _ _ (M * `|x - z|)) ?ler_wpM2r -?ltr_pdivlMl//. by near: z; apply: cvgr_dist_lt; rewrite // mulr_gt0 ?invr_gt0. rewrite (@le_lt_trans _ _ (`|k - l| * M)) ?ler_wpM2l -?ltr_pdivlMr//. near: z; near: M. - exact: (@cvg_bounded _ R^o _ _ _ _ _ (@cvg_refl _ _)). + exact: (@cvg_bounded _ _ R^o _ _ _ _ _ (@cvg_refl _ _)). by near: l; apply: cvgr_dist_lt; rewrite // divr_gt0. Unshelve. all: by end_near. Qed. -Lemma bounded_cst (K : numFieldType) {V : PseudoMetricNormedZmodule.type K} +Lemma bounded_cst d (K : numFieldType) {V : PseudoMetricNormedZmodule.type d K} (k : V) T (A : set T) : [bounded k | _ in A]. Proof. rewrite /bounded_near; near=> M => t At /=. diff --git a/theories/normedtype_theory/tvs.v b/theories/normedtype_theory/tvs.v index 080ef6b38e..c2c4045780 100644 --- a/theories/normedtype_theory/tvs.v +++ b/theories/normedtype_theory/tvs.v @@ -101,6 +101,7 @@ From mathcomp Require Import pseudometric_normed_Zmodule. (* *) (******************************************************************************) +Reserved Notation "P .-seminorm" (at level 4, format "P .-seminorm"). Reserved Notation "'{' 'linear_continuous' U '->' V '|' s '}'" (at level 0, U at level 98, V at level 99, format "{ 'linear_continuous' U -> V | s }"). @@ -150,15 +151,15 @@ move=> [convA balA] [convB balB]; split. + by apply/balB; [exact: r1|exists y2]. Qed. -HB.structure Definition NbhsLmodule (K : numDomainType) := - {M of Nbhs M & GRing.Lmodule K M}. +HB.structure Definition NbhsLmodule d (K : numDomainType) := + {M of Nbhs d M & GRing.Lmodule K M}. #[short(type="preTopologicalLmodType")] -HB.structure Definition PreTopologicalLmodule (K : numDomainType) := - {M of Topological M & GRing.Lmodule K M}. +HB.structure Definition PreTopologicalLmodule d (K : numDomainType) := + {M of Topological d M & GRing.Lmodule K M}. Section properties_of_preTopologicalLmodule. -Context (R : numDomainType) (E : preTopologicalLmodType R) (U : set E). +Context d (R : numDomainType) (E : preTopologicalLmodType d R) (U : set E). Lemma nbhsN_subproof (f : continuous (fun z : R^o * E => z.1 *: z.2)) (x : E) : nbhs x U -> nbhs (-x) (-%R @` U). @@ -193,18 +194,18 @@ Unshelve. all: by end_near. Qed. End properties_of_preTopologicalLmodule. -HB.mixin Record TopologicalZmodule_isTopologicalLmodule (R : numDomainType) M - & PreTopologicalLmodule R M := { +HB.mixin Record TopologicalZmodule_isTopologicalLmodule d (R : numDomainType) M + & PreTopologicalLmodule d R M := { scale_continuous : continuous (fun z : R^o * M => z.1 *: z.2) }. #[short(type="topologicalLmodType")] -HB.structure Definition TopologicalLmodule (K : numDomainType) := - {M of TopologicalZmodule M & GRing.Lmodule K M - & TopologicalZmodule_isTopologicalLmodule K M}. +HB.structure Definition TopologicalLmodule d (K : numDomainType) := + {M of TopologicalZmodule d M & GRing.Lmodule K M + & TopologicalZmodule_isTopologicalLmodule d K M}. Section TopologicalLmodule_theory. -Context {R : numFieldType} (E : topologicalLmodType R). +Context {d} {R : numFieldType} (E : topologicalLmodType d R). Lemma fun_cvgZ (T : Type) (U : set_system T) {FF : Filter U} (l : T -> R) (f : T -> E) (r : R) a : @@ -238,7 +239,7 @@ Unshelve. all: by end_near. Qed. End TopologicalLmodule_theory. Section TopologicalLmodule_numDomain. -Context {R : numDomainType} (E : topologicalLmodType R). +Context {d} {R : numDomainType} (E : topologicalLmodType d R). Lemma nbhs0N (U : set E) : nbhs 0 U -> nbhs 0 (-%R @` U). Proof. exact/nbhs0N_subproof/scale_continuous. Qed. @@ -280,7 +281,8 @@ End TopologicalLmodule_numDomain. Section TopologicalLmodule_numField. -Lemma openZ (R : numFieldType) (E : topologicalLmodType R) (U : set E) (r : R) : +Lemma openZ d (R : numFieldType) (E : topologicalLmodType d R) + (U : set E) (r : R) : r != 0 -> open U -> open ( *:%R r @` U ). Proof. move=> r0; rewrite openE /interior /= => openU z /= [x Ux <-]. @@ -291,7 +293,8 @@ Qed. End TopologicalLmodule_numField. Section TopologicalLmodule_theory. -Context {E : Type} {R : numFieldType} {F G : topologicalLmodType R}. +Context {d d'} {E : Type} {R : numFieldType} + {F : topologicalLmodType d R} {G : topologicalLmodType d' R}. Lemma continuousfor0_continuous (f : {linear F -> G}) : {for 0, continuous f} -> continuous f. @@ -308,7 +311,7 @@ suff: (f y - f x)@[y --> x] --> (0 : G). by move=> y [/= g Ag <-]; rewrite subrK. move=> g/= Agfx; eexists; first exact: Agfx. by rewrite addrK. - have:= @continuous_shift _ (0 : G) (f x) A. + have:= @continuous_shift _ _ (0 : G) (f x) A. by rewrite opprK add0r => /(_ nA); exact. rewrite /nbhs /=; apply/filterS => z /=; rewrite /B /=. by move=> [y Ay]; rewrite linearB => /subIr <-. @@ -321,7 +324,7 @@ Qed. End TopologicalLmodule_theory. Section topologicalLmodType_realFieldType. -Context {R : realFieldType} {E : topologicalLmodType R}. +Context {d} {R : realFieldType} {E : topologicalLmodType d R}. Implicit Type x : E. Lemma continuousZl x (s : R) : {for s, continuous (fun t : R^o => t *: x)}. @@ -340,32 +343,32 @@ Qed. End topologicalLmodType_realFieldType. -HB.factory Record TopologicalNmodule_isTopologicalLmodule (R : numDomainType) M - & PreTopologicalLmodule R M := { +HB.factory Record TopologicalNmodule_isTopologicalLmodule + d (R : numDomainType) M & PreTopologicalLmodule d R M := { scale_continuous : continuous (fun z : R^o * M => z.1 *: z.2) }. -HB.builders Context R M & TopologicalNmodule_isTopologicalLmodule R M. +HB.builders Context d R M & TopologicalNmodule_isTopologicalLmodule d R M. Let opp_continuous : continuous (-%R : M -> M). Proof. move=> x; rewrite /continuous_at. rewrite -(@eq_cvg _ _ _ (fun x => -1 *: x)); first by move=> y; rewrite scaleN1r. rewrite -[- x]scaleN1r. -apply: (@continuous_comp M (R^o * M)%type M (fun x => (-1, x)) +apply: (@continuous_comp _ _ _ M (R^o * M)%type M (fun x => (-1, x)) (fun x => x.1 *: x.2)); last exact: scale_continuous. by apply: (@cvg_pair _ _ _ _ (nbhs (-1 : R^o))); [exact: cvg_cst|exact: cvg_id]. Qed. #[warning="-HB.no-new-instance"] HB.instance Definition _ := - TopologicalNmodule_isTopologicalZmodule.Build M opp_continuous. + TopologicalNmodule_isTopologicalZmodule.Build _ M opp_continuous. HB.instance Definition _ := - TopologicalZmodule_isTopologicalLmodule.Build R M scale_continuous. + TopologicalZmodule_isTopologicalLmodule.Build _ R M scale_continuous. HB.end. -HB.mixin Record Uniform_isConvexTvs (R : numDomainType) E - & Uniform E & GRing.Lmodule R E := { +HB.mixin Record Uniform_isConvexTvs d (R : numDomainType) E + & Uniform d E & GRing.Lmodule R E := { locally_convex : exists2 B : set_system E, (forall b, b \in B -> absolutely_convex_set b) & (nbhs_basis 0) B }. @@ -373,8 +376,9 @@ HB.mixin Record Uniform_isConvexTvs (R : numDomainType) E absolutely_convex_set can be derived from it, by taking the absolute_convex closure *) #[short(type="convexTvsType")] -HB.structure Definition ConvexTvs (R : numDomainType) := - {E of Uniform_isConvexTvs R E & UniformZmodule E & TopologicalLmodule R E}. +HB.structure Definition ConvexTvs d (R : numDomainType) := + {E of Uniform_isConvexTvs d R E + & UniformZmodule d E & TopologicalLmodule d R E}. HB.mixin Record isSubConvexSpace (R : numDomainType) (V : convType R) (S : pred V) U & SubChoice V S U & ConvexSpace R U := { @@ -386,12 +390,14 @@ HB.structure Definition SubConvexSpace (R : numDomainType) (V : convType R) S := { U of SubChoice V S U & ConvexSpace R U & isSubConvexSpace R V S U }. #[short(type="subConvexTvsType")] -HB.structure Definition SubConvexTvs (R : numDomainType) (V : convexTvsType R) - (S : pred V) := - { U of SubTopological V S U & ConvexTvs R U & @GRing.SubLmodule R V S U }. +HB.structure Definition SubConvexTvs d d' (R : numDomainType) + (V : convexTvsType d R) (S : pred V) := + { U of SubTopological d d' S U & ConvexTvs d' R U + & @GRing.SubLmodule R V S U }. Section SubLmodule_isSubConvexTvs. -Context (R : numFieldType) (V : convexTvsType R) (S : pred V) (U : subLmodType S). +Context d (R : numFieldType) (V : convexTvsType d R) + (S : pred V) (U : subLmodType S). Definition init_subconvextvs := sub_initial_topology U. @@ -413,7 +419,7 @@ apply: cvg_pair => //=. Qed. HB.instance Definition _ := - @PreTopologicalNmodule_isTopologicalNmodule.Build init_subconvextvs add_sub. + @PreTopologicalNmodule_isTopologicalNmodule.Build _ init_subconvextvs add_sub. Let opp_sub : continuous (-%R : init_subconvextvs -> init_subconvextvs). Proof. @@ -424,7 +430,7 @@ by apply: continuous_comp; [exact: continuous_valE|exact: opp_continuous]. Qed. HB.instance Definition _ := - TopologicalNmodule_isTopologicalZmodule.Build init_subconvextvs opp_sub. + TopologicalNmodule_isTopologicalZmodule.Build _ init_subconvextvs opp_sub. Let scale_sub : continuous (fun z : R^o * init_subconvextvs => z.1 *: z.2). Proof. @@ -442,7 +448,7 @@ by move=> su/= [xru C'u]; split; [exact: xrB|exact: C'C]. Qed. HB.instance Definition _ := - TopologicalZmodule_isTopologicalLmodule.Build R init_subconvextvs scale_sub. + TopologicalZmodule_isTopologicalLmodule.Build _ R init_subconvextvs scale_sub. Let add_unif_continuous : unif_continuous (fun x : init_subconvextvs * init_subconvextvs => x.1 + x.2). @@ -457,7 +463,7 @@ by apply: pair_unif_continuous => //=; Qed. HB.instance Definition _ := - PreUniformNmodule_isUniformNmodule.Build init_subconvextvs add_unif_continuous. + PreUniformNmodule_isUniformNmodule.Build _ init_subconvextvs add_unif_continuous. Let opp_unif_continuous : unif_continuous (-%R : init_subconvextvs -> init_subconvextvs). Proof. @@ -469,14 +475,14 @@ by apply: unif_continuous_comp; Qed. HB.instance Definition _ := - UniformNmodule_isUniformZmodule.Build init_subconvextvs opp_unif_continuous. + UniformNmodule_isUniformZmodule.Build _ init_subconvextvs opp_unif_continuous. Local Open Scope convex_scope. Let locally_convex_sub : exists2 B : set_system init_subconvextvs, (forall b, b \in B -> absolutely_convex_set b) & nbhs_basis 0 B. Proof. -have [B absconvB [B0 nbhsb]] := @locally_convex R V. +have [B absconvB [B0 nbhsb]] := @locally_convex _ R V. rewrite /filter_from /= in nbhsb. exists [set \val @^-1` b | b in B]. move=> a; rewrite inE /= => -[b] /mem_set/absconvB [convb balb] <-; split. @@ -497,20 +503,20 @@ Qed. Local Close Scope convex_scope. HB.instance Definition _ := - @Uniform_isConvexTvs.Build R init_subconvextvs locally_convex_sub. + @Uniform_isConvexTvs.Build _ R init_subconvextvs locally_convex_sub. HB.instance Definition _ := GRing.SubLmodule.on init_subconvextvs. End SubLmodule_isSubConvexTvs. -HB.factory Record PreTopologicalLmod_isConvexTvs (R : numDomainType) E - & PreTopologicalLmodule R E := { +HB.factory Record PreTopologicalLmod_isConvexTvs d (R : numDomainType) E + & PreTopologicalLmodule d R E := { add_continuous : continuous (fun x : E * E => x.1 + x.2) ; scale_continuous : continuous (fun z : R^o * E => z.1 *: z.2) ; locally_convex : exists2 B : set_system E, (forall b, b \in B -> absolutely_convex_set b) & nbhs_basis 0 B }. -HB.builders Context R E & PreTopologicalLmod_isConvexTvs R E. +HB.builders Context d R E & PreTopologicalLmod_isConvexTvs d R E. Definition entourage : set_system (E * E) := fun P => exists (U : set E), nbhs (0 : E) U /\ @@ -593,16 +599,16 @@ apply/funext => U; apply/propext => /=; rewrite /entourage /=; split. by exists (x - z); rewrite ?opprB. Unshelve. all: by end_near. Qed. -HB.instance Definition _ := Nbhs_isUniform_mixin.Build E +HB.instance Definition _ := Nbhs_isUniform_mixin.Build _ E entourage_filter entourage_refl entourage_inv entourage_split_ex nbhsE. HB.instance Definition _ := - PreTopologicalNmodule_isTopologicalNmodule.Build E add_continuous. + PreTopologicalNmodule_isTopologicalNmodule.Build _ E add_continuous. HB.instance Definition _ := - TopologicalNmodule_isTopologicalLmodule.Build R E scale_continuous. + TopologicalNmodule_isTopologicalLmodule.Build _ R E scale_continuous. Let nbhs0_split (U : set E) : nbhs 0 U -> exists2 V : set E, nbhs 0 V & forall u v, V u -> V v -> U (u + v). @@ -631,7 +637,7 @@ by apply: VU; [exact/set_mem/Ax|exact/set_mem/Ay]. Qed. HB.instance Definition _ := - PreUniformNmodule_isUniformNmodule.Build E add_unif_continuous. + PreUniformNmodule_isUniformNmodule.Build _ E add_unif_continuous. Let opp_unif_continuous : unif_continuous (-%R : E -> E). Proof. @@ -645,14 +651,14 @@ by rewrite -opprD. Qed. HB.instance Definition _ := - UniformNmodule_isUniformZmodule.Build E opp_unif_continuous. + UniformNmodule_isUniformZmodule.Build _ E opp_unif_continuous. -HB.instance Definition _ := Uniform_isConvexTvs.Build R E locally_convex. +HB.instance Definition _ := Uniform_isConvexTvs.Build _ R E locally_convex. HB.end. -HB.factory Record NbhsBasisAt0_isConvexTvs (R : numFieldType) E - & GRing.Lmodule R E := { +HB.factory Record NbhsBasisAt0_isConvexTvs + (d : fdisp_t) (R : numFieldType) (E : Type) & GRing.Lmodule R E := { nbhsbasis_at0 : set_system E ; nonempty_nbhsbasis_at0 : nbhsbasis_at0 !=set0 ; mem0_nbhsbasis_at0 : forall B, nbhsbasis_at0 B -> B 0 ; @@ -661,13 +667,14 @@ HB.factory Record NbhsBasisAt0_isConvexTvs (R : numFieldType) E expand_nbhsbasis_at0 : forall B r, nbhsbasis_at0 B -> exists2 U, nbhsbasis_at0 U & ( *:%R r) @` U `<=` B ; nbhsbasis_at0I : forall U V, nbhsbasis_at0 U -> nbhsbasis_at0 V -> - exists2 W, nbhsbasis_at0 W & W `<=` U `&` V }. + exists2 W, nbhsbasis_at0 W & W `<=` U `&` V +}. Definition filter_from_basis0 (R : numFieldType) (E : zmodType) (nbhsbasis_at0 : set_system E) (x : E) := filter_from [set U | exists2 V, nbhsbasis_at0 V & [set x] `+ V = U] id. -HB.builders Context R E & NbhsBasisAt0_isConvexTvs R E. +HB.builders Context d R E & NbhsBasisAt0_isConvexTvs d R E. Let nbhs_fromfilter0 := @filter_from_basis0 R E (nbhsbasis_at0). @@ -724,10 +731,10 @@ apply: addsetS => //; apply: subset_trans DDC; apply: addsetS => //. by move=> x ->. Qed. -HB.instance Definition _ := @hasNbhs.Build E nbhs_fromfilter0. +HB.instance Definition _ := @hasNbhs.Build d E nbhs_fromfilter0. HB.instance Definition _ := - @Nbhs_isNbhsTopological.Build E nbhs_filter nbhs_singleton nbhs_nbhs. + @Nbhs_isNbhsTopological.Build _ E nbhs_filter nbhs_singleton nbhs_nbhs. Let add_continuous : continuous (fun x : E * E => x.1 + x.2). Proof. @@ -821,13 +828,13 @@ move => b [a] /= [a'] fa; rewrite add0set => <- ab /=. by exists a' => //=; split => //; exact: mem0_nbhsbasisat0. Qed. -HB.instance Definition _ := @PreTopologicalLmod_isConvexTvs.Build R E +HB.instance Definition _ := @PreTopologicalLmod_isConvexTvs.Build _ R E add_continuous scale_continuous locally_convex. HB.end. -HB.factory Record NbhsSubbasisAt0_isConvexTvs (R : numFieldType) E - & GRing.Lmodule R E := { +HB.factory Record NbhsSubbasisAt0_isConvexTvs + (d : fdisp_t) (R : numFieldType) E & GRing.Lmodule R E := { nbhssubbasis_at0 : set_system E ; nonempty_nbhssubbasis_at0 : nbhssubbasis_at0 !=set0 ; mem0_nbhssubbasis_at0 : forall B, nbhssubbasis_at0 B -> B 0 ; @@ -840,7 +847,7 @@ Definition finI_fromsubbasis0 (R : numFieldType) (E : zmodType) (nbhssubbasis0 : set_system E) := open_finI_from nbhssubbasis0 id. -HB.builders Context R E & NbhsSubbasisAt0_isConvexTvs R E. +HB.builders Context d R E & NbhsSubbasisAt0_isConvexTvs d R E. Let nbhsbasis_at0 := @finI_fromsubbasis0 R E nbhssubbasis_at0. @@ -923,7 +930,7 @@ have /fI := iI; rewrite asboolE => /absconvex_nbhssubbasis_at0[_ +]. by move=> /(_ r r1 (r *: y)); apply => /=; exists y => //; exact: capy. Qed. -HB.instance Definition _ := @NbhsBasisAt0_isConvexTvs.Build R E +HB.instance Definition _ := @NbhsBasisAt0_isConvexTvs.Build d R E nbhsbasis_at0 nonempty_nbhsbasisat0 mem0_nbhsbasis_at0 absorbing_nbhsbasis_at0 absconvex_nbhsbasis_at0 expand_nbhsbasis_at0 nbhsbasis_at0I. @@ -970,23 +977,24 @@ split; first by move=> /= ? [r r0 ->]; exact: nbhsx_ballx. by move=> /= B [r r0 Br]; exists (ball 0 r); [exists r|exact: Br]. Qed. -HB.instance Definition _ := - TopologicalNmodule_isTopologicalLmodule.Build R R^o standard_scale_continuous. +HB.instance Definition _ := TopologicalNmodule_isTopologicalLmodule.Build _ + R R^o standard_scale_continuous. HB.instance Definition _ := - Uniform_isConvexTvs.Build R R^o standard_locally_convex_set. + Uniform_isConvexTvs.Build _ R R^o standard_locally_convex_set. End standard_topology. Section prod_ConvexTvs. -Context (K : numFieldType) (E F : convexTvsType K). +Context d d' (K : numFieldType) + (E : convexTvsType d K) (F : convexTvsType d' K). Local Lemma prod_scale_continuous : continuous (fun z : K^o * (E * F) => z.1 *: z.2). Proof. move => [/= r [x y]] /= U /= []/= [A B] /= [nA nB] nU. -have [/= A0 [A01 A02] nA1] := @scale_continuous K E (r, x) _ nA. -have [/= B0 [B01 B02] nB1] := @scale_continuous K F (r, y) _ nB . +have [/= A0 [A01 A02] nA1] := @scale_continuous _ K E (r, x) _ nA. +have [/= B0 [B01 B02] nB1] := @scale_continuous _ K F (r, y) _ nB . exists (A0.1 `&` B0.1, A0.2 `*` B0.2). by split; [exact: filterI|exists (A0.2,B0.2)]. by move=> [l [e f]] /= [] [Al Bl] [] Ae Be; apply: nU; split; @@ -997,8 +1005,8 @@ Local Lemma prod_locally_convex : exists2 B : set_system (E * F), (forall b, b \in B -> absolutely_convex_set b) & nbhs_basis (0, 0) B. Proof. -have [Be Bce [Be0 Beb]] := @locally_convex K E. -have [Bf Bcf [Bf0 Bfb]] := @locally_convex K F. +have [Be Bce [Be0 Beb]] := @locally_convex _ K E. +have [Bf Bcf [Bf0 Bfb]] := @locally_convex _ K F. pose B := [set be `*` bf | be in Be & bf in Bf]. have B00 : nbhs_basis (0, 0) B. split. @@ -1014,35 +1022,36 @@ by apply: absolutely_convex_setX; [exact/Bce/mem_set|exact/Bcf/mem_set]. Qed. HB.instance Definition _ := TopologicalNmodule_isTopologicalLmodule.Build - K (E * F)%type prod_scale_continuous. + _ K (E * F)%type prod_scale_continuous. HB.instance Definition _ := - Uniform_isConvexTvs.Build K (E * F)%type prod_locally_convex. + Uniform_isConvexTvs.Build _ K (E * F)%type prod_locally_convex. End prod_ConvexTvs. -HB.structure Definition LinearContinuous (K : numDomainType) (E : NbhsLmodule.type K) - (F : NbhsZmodule.type) (s : K -> F -> F) := - {f of @GRing.Linear K E F s f & @Continuous E F f }. +HB.structure Definition LinearContinuous d d' (K : numDomainType) + (E : NbhsLmodule.type d K) (F : NbhsZmodule.type d') (s : K -> F -> F) := + {f of @GRing.Linear K E F s f & @Continuous d d' E F f }. (* see https://github.com/math-comp/math-comp/issues/1536 we use GRing.Scale.law even though it is claimed to be internal *) -HB.factory Structure isLinearContinuous (K : numDomainType) (E : NbhsLmodule.type K) - (F : NbhsZmodule.type) (s : GRing.Scale.law K F) (f : E -> F) := { +HB.factory Structure isLinearContinuous d d' (K : numDomainType) + (E : NbhsLmodule.type d K) (F : NbhsZmodule.type d') + (s : GRing.Scale.law K F) (f : E -> F) := { linearP : linear_for s f ; continuousP : continuous f }. -HB.builders Context K E F s f & @isLinearContinuous K E F s f. +HB.builders Context d d' K E F s f & @isLinearContinuous d d' K E F s f. HB.instance Definition _ := GRing.isLinear.Build K E F s f linearP. -HB.instance Definition _ := isContinuous.Build E F f continuousP. +HB.instance Definition _ := isContinuous.Build _ _ E F f continuousP. HB.end. Section lcfun_pred. -Context {K : numDomainType} {E : NbhsLmodule.type K} {F : NbhsZmodule.type} - {s : K -> F -> F}. +Context {d d'} {K : numDomainType} {E : NbhsLmodule.type d K} + {F : NbhsZmodule.type d'} {s : K -> F -> F}. Definition lcfun : {pred E -> F} := mem [set f | linear_for s f /\ continuous f]. @@ -1054,23 +1063,23 @@ Canonical lcfun_keyed := KeyedPred lcfun_key. End lcfun_pred. Notation "{ 'linear_continuous' U -> V | s }" := - (@LinearContinuous.type _ U%type V%type s) : type_scope. + (@LinearContinuous.type _ _ _ U%type V%type s) : type_scope. Notation "{ 'linear_continuous' U -> V }" := {linear_continuous U%type -> V%type | *:%R} : type_scope. Section lcfun. -Context {R : numDomainType} {E : NbhsLmodule.type R} - {F : NbhsZmodule.type} {s : GRing.Scale.law R F}. +Context {d d'} {R : numDomainType} {E : NbhsLmodule.type d R} + {F : NbhsZmodule.type d'} {s : GRing.Scale.law R F}. Notation T := {linear_continuous E -> F | s}. -Notation lcfun := (@lcfun _ E F s). +Notation lcfun := (@lcfun _ _ _ E F s). Section Sub. Context (f : E -> F) (fP : f \in lcfun). -#[local] Definition lcfun_Sub_subproof := - @isLinearContinuous.Build _ E F s f (proj1 (set_mem fP)) (proj2 (set_mem fP)). +#[local] Definition lcfun_Sub_subproof := @isLinearContinuous.Build _ _ _ E F s + f (proj1 (set_mem fP)) (proj2 (set_mem fP)). #[local] HB.instance Definition _ := lcfun_Sub_subproof. @@ -1116,9 +1125,10 @@ Qed. End lcfun. Section lcfun_comp. -Context {R : numDomainType} {E F : NbhsLmodule.type R} - {S : NbhsZmodule.type} {s : GRing.Scale.law R S} - (f : {linear_continuous E -> F}) (g : {linear_continuous F -> S | s}). +Context {d1 d2 d3} {R : numDomainType} {E : NbhsLmodule.type d1 R} + {F : NbhsLmodule.type d2 R} {S : NbhsZmodule.type d3} + {s : GRing.Scale.law R S} (f : {linear_continuous E -> F}) + (g : {linear_continuous F -> S | s}). #[local] Lemma lcfun_comp_subproof1 : linear_for s (g \o f). Proof. by move=> *; move=> *; rewrite !linearP. Qed. @@ -1126,40 +1136,41 @@ Proof. by move=> *; move=> *; rewrite !linearP. Qed. #[local] Lemma lcfun_comp_subproof2 : continuous (g \o f). Proof. by move=> x; apply: continuous_comp; exact/continuous_fun. Qed. -HB.instance Definition _ := @isLinearContinuous.Build R E S s (g \o f) +HB.instance Definition _ := @isLinearContinuous.Build _ _ R E S s (g \o f) lcfun_comp_subproof1 lcfun_comp_subproof2. End lcfun_comp. Section lcfun_lmodtype. Import GRing.Theory. -Context {R : numFieldType} {E F : convexTvsType R}. +Context {d d'} {R : numFieldType} + {E : convexTvsType d R} {F : convexTvsType d' R}. Implicit Types (r : R) (f g : {linear_continuous E -> F}). Lemma null_fun_continuous : continuous (\0 : E -> F). Proof. by apply: cst_continuous. Qed. -HB.instance Definition _ := isContinuous.Build E F \0 null_fun_continuous. +HB.instance Definition _ := isContinuous.Build _ _ E F \0 null_fun_continuous. #[local] Lemma lcfun_continuousD f g : continuous (f \+ g). Proof. by move=> /= x; apply: cvgD; exact: continuous_fun. Qed. HB.instance Definition _ f g := - isContinuous.Build E F (f \+ g) (@lcfun_continuousD f g). + isContinuous.Build _ _ E F (f \+ g) (@lcfun_continuousD f g). #[local] Lemma lcfun_continuousN f : continuous (\- f). Proof. by move=> /= x; apply: cvgN; exact: continuous_fun. Qed. HB.instance Definition _ f := - isContinuous.Build E F (\- f) (@lcfun_continuousN f). + isContinuous.Build _ _ E F (\- f) (@lcfun_continuousN f). #[local] Lemma lcfun_continuousM r g : continuous (r \*: g). Proof. by move=> /= x; apply: fun_cvgZr; exact: continuous_fun. Qed. HB.instance Definition _ r g := - isContinuous.Build E F (r \*: g) (@lcfun_continuousM r g). + isContinuous.Build _ _ E F (r \*: g) (@lcfun_continuousM r g). -#[local] Lemma lcfun_submod_closed : submod_closed (@lcfun R E F *:%R). +#[local] Lemma lcfun_submod_closed : submod_closed (@lcfun _ _ R E F *:%R). Proof. split; first by rewrite inE; split; first apply/linearP; exact: cst_continuous. move=> r /= _ _ /lcfunP[f] /lcfunP[g]. @@ -1175,8 +1186,8 @@ HB.instance Definition _ := End lcfun_lmodtype. Section lcfunproperties. -Context {R : numDomainType} {E F : NbhsLmodule.type R} - (f : {linear_continuous E -> F}). +Context {d d'} {R : numDomainType} {E : NbhsLmodule.type d R} + {F : NbhsLmodule.type d' R} (f : {linear_continuous E -> F}). #[warn(note="Consider using `continuous_fun` instead.",cats="discoverability")] Lemma lcfun_continuous : continuous f. @@ -1191,9 +1202,9 @@ End lcfunproperties. Local Open Scope convex_scope. Section openbasis. -Context (R : realType) (E : convexTvsType R). +Context d (R : realType) (E : convexTvsType d R). -Definition nbhsbasis_convextvs := sval (cid2 (@locally_convex _ E)). +Definition nbhsbasis_convextvs := sval (cid2 (@locally_convex _ _ E)). Definition open_nbhsbasis_convextvs := [set interior b | b in nbhsbasis_convextvs]. @@ -1204,7 +1215,7 @@ Lemma has_open_nbhs_basis : nbhs_basis 0 open_nbhsbasis_convextvs /\ (forall b, open_nbhsbasis_convextvs b -> open b /\ absolutely_convex_set b). Proof. -have [absconv [] nbhs0 basis] := svalP (cid2 (@locally_convex _ E)). +have [absconv [] nbhs0 basis] := svalP (cid2 (@locally_convex _ _ E)). split. split; move=> a /=; first by move=> [b /nbhs0] nbhsb <-; exact: nbhs_interior. move=> /basis /= [b /= nbhsb ba]; exists (interior b); first by exists b. @@ -1249,7 +1260,7 @@ Proof. move=> b Bb x. have [/(_ b Bb) + _] := basis_opennbhsbasis. rewrite -(scale0r x) => n0b. -have [r /= r0 b0rb] := @continuousZl _ _ x 0 b n0b. +have [r /= r0 b0rb] := @continuousZl _ _ _ x 0 b n0b. exists (r / 2); first exact: divr_gt0. apply/mem_set/b0rb. by rewrite /ball_ /= sub0r normrN gtr0_norm ?divr_gt0// gtr_pMr// invf_lt1// ltr1n. @@ -1370,6 +1381,12 @@ HB.instance Definition _ := @isSemiNorm.Build K V gauge_fun gauge0 End gauge. +Fact seminorm_fdisp {R : realFieldType} {E : lmodType R} + (P : set (Norm.SemiNorm.type E)) : fdisp_t. +Proof. by []. Qed. + +Notation "P .-seminorm" := (seminorm_fdisp P) : fdisp_scope. + Definition seminorm_on {R : realFieldType} {E : lmodType R} (P : set (Norm.SemiNorm.type E)) (Hp : P !=set0) : Type := E. @@ -1468,7 +1485,8 @@ rewrite inE /ball /ball_ /= sub0r normrN !normZ !normrM !normr_id !normfV. by rewrite -mulrA mulVf ?normr_eq0// mulr1 !gtr0_norm ?gtr_pMr ?invf_lt1 ?ltr1n. Qed. -HB.instance Definition _ := @NbhsSubbasisAt0_isConvexTvs.Build R (seminorm_on P0) +HB.instance Definition _ := @NbhsSubbasisAt0_isConvexTvs.Build + (seminorm_fdisp P) R (seminorm_on P0) seminorm_subbasis nonempty_subbasis mem0_seminorm_subbasis absorbing_seminorm absolutely_convex_seminorm_subbasis expand_seminorm_subbasis. @@ -1501,7 +1519,8 @@ apply/seteqP; split => z /=. by rewrite norm0 => b0rp; exists 0 => //; exists z => //; rewrite add0r. Qed. -Lemma continuous_seminorm x p : P p -> continuous_at x (p : seminorm_on P0 -> R). +Lemma continuous_seminorm x p : + P p -> continuous_at x (p : seminorm_on P0 -> R). Proof. move=> Pp. suff: (p y - p x)@[y --> x] --> (0 : R). @@ -1512,7 +1531,7 @@ suff: (p y - p x)@[y --> x] --> (0 : R). exists [fset p @^-1` (ball (0 : R) r)]%fset. by move => y; rewrite 2!inE => /eqP ->; exists p => //; exists r. apply/seteqP; split => t /=. - rewrite /bigcap /= => /(_ (p @^-1` (ball (0 : R) r))). + rewrite /bigcap /= => /(_ (p @^-1` (ball (0 : R) r))). by apply; rewrite inE. by move => h; rewrite /bigcap /= => ?; rewrite inE => /eqP -> /=. move => t /= [? ->] [y] bally <-; apply: pxrA => /=. @@ -1528,14 +1547,14 @@ have pshift0 : (p \o shift (- x)) x0 @[x0 --> nbhs x] --> (0 : R). by rewrite -(@norm0 _ _ p); exact: continuous_at0_seminorm. by rewrite -(subrr x)=> A /= /continuous_shift; exact. apply: (@squeeze_cvgr _ (nbhs x)) => /=; first exact: nearp. - by rewrite -oppr0; apply: (@cvgN _ R^o); exact: pshift0. + by rewrite -oppr0; apply: (@cvgN _ _ R^o); exact: pshift0. exact: pshift0. Qed. End convex_topology_seminorm. Section generating_seminorm. -Context {R : realType} {E : convexTvsType R}. +Context {d} {R : realType} {E : convexTvsType d R}. Definition gauge_fun_basis (b : set E) (h : open_nbhsbasis_convextvs b) := gauge_fun (open_absconvex_opennbhsbasis h).2 (absorbing_opennbhsbasis h). @@ -1550,7 +1569,7 @@ by exists (gauge_fun_basis Bb), b, Bb. Qed. #[local] Notation seminormE := - (@seminorm_on R E seminorm_of seminorm_ofneq0 : convexTvsType R). + (@seminorm_on R E seminorm_of seminorm_ofneq0 : convexTvsType _ R). Let ball_gauge_fun (A : set E) (r : R) (r0 : 0 < r) (absA : absolutely_convex_set A) (pabsA : absorbing_set A) (_ : open A) : diff --git a/theories/normedtype_theory/urysohn.v b/theories/normedtype_theory/urysohn.v index 64d388e2da..ac5c4e0f59 100644 --- a/theories/normedtype_theory/urysohn.v +++ b/theories/normedtype_theory/urysohn.v @@ -39,12 +39,12 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section urysohn_separator. -Context {T : uniformType} {R : realType}. +Context {d} {T : uniformType d} {R : realType}. Context (A B : set T) (E : set (T * T)). Hypothesis entE : entourage E. Hypothesis AB0 : A `*` B `&` E = set0. -Local Notation T' := [the pseudoMetricType R of gauge.type entE]. +Let T' : pseudoMetricType _ R := gauge.type entE. Local Lemma urysohn_separation : exists (f : T -> R), [/\ continuous f, range f `<=` `[0, 1], @@ -52,7 +52,7 @@ Local Lemma urysohn_separation : exists (f : T -> R), Proof. have [eps exy] : exists (eps : {posnum R}), forall (x y : T'), A x -> B y -> ~ ball x eps%:num y. - have : @entourage T' E by exists O => /=. + have : @entourage _ T' E by exists O => /=. rewrite -entourage_ballE; case=> _/posnumP[eps] epsdiv; exists eps. move=> x y Ax By bxy; have divxy := epsdiv (x, y) bxy. by have : set0 (x, y) by rewrite -AB0; split. @@ -61,12 +61,12 @@ have [->|/set0P[a A0]] := eqVneq A set0. - by move=> ? [? _ <-]; rewrite /= in_itv /=; apply/andP; split => //. - by rewrite image_set0. - by move=> ? [? ? <-]. -have dfin x : @edist_inf R T' A x \is a fin_num. +have dfin x : @edist_inf _ R T' A x \is a fin_num. rewrite ge0_fin_numE ?edist_inf_ge0 //; apply: le_lt_trans. by apply: ereal_inf_lbound; exists a. rewrite -ge0_fin_numE ?edist_ge0 //; apply/edist_finP => /=; exists 2 => //. exact: countable_uniform.countable_uniform_bounded. -pose f' := (fun z => fine (@edist_inf R T' A z)) \min (fun=> eps%:num). +pose f' := (fun z => fine (@edist_inf _ R T' A z)) \min (fun=> eps%:num). pose f z := (f' z)/eps%:num; exists f; split. - move=> x; rewrite /f; apply: (@cvgM R T (nbhs x)) => //. suff : {for x, continuous (f' : T' -> R)}. @@ -82,19 +82,19 @@ pose f z := (f' z)/eps%:num; exists f; split. - by move=> ? [z Az] <-; rewrite /f/f' /= edist_inf0 // fine0 min_l// mul0r. - move=> ? [b Bb] <-; rewrite /f /f'/=; case: ltP; rewrite ?divff//. rewrite -lte_fin fineK// => /ereal_inf_lt [_ [z Az <-]] ebz. - by have [] := exy _ _ Az Bb; exact/ball_sym/(@edist_lt_ball R T' _ (b, z)). + by have [] := exy _ _ Az Bb; exact/ball_sym/(@edist_lt_ball _ R T' _ (b, z)). Qed. End urysohn_separator. Section topological_urysohn_separator. -Context {T : topologicalType} {R : realType}. +Context {d} {T : topologicalType d} {R : realType}. Definition uniform_separator (A B : set T) := - exists (uT : @Uniform.axioms_ T^o) (E : set (T * T)), + exists d (uT : @Uniform.axioms_ d T^o) (E : set (T * T)), let UT := Uniform.Pack uT in [/\ - @entourage UT E, A `*` B `&` E = set0 & - (forall x, @nbhs UT UT x `<=` @nbhs T T x)]. + @entourage _ UT E, A `*` B `&` E = set0 & + (forall x, @nbhs _ UT UT x `<=` @nbhs _ T T x)]. Local Lemma Urysohn' (A B : set T) : exists (f : T -> R), [/\ continuous f, @@ -102,8 +102,8 @@ Local Lemma Urysohn' (A B : set T) : exists (f : T -> R), & uniform_separator A B -> f @` A `<=` [set 0] /\ f @` B `<=` [set 1]]. Proof. -have [[? [E [entE ABE0 coarseT]]]|nP] := pselect (uniform_separator A B). - have [f] := @urysohn_separation _ R _ _ _ entE ABE0. +have [[d' [? [E [entE ABE0 coarseT]]]]|nP] := pselect (uniform_separator A B). + have [f] := @urysohn_separation _ _ R _ _ _ entE ABE0. by case=> ctsf ? ? ?; exists f; split => // ? ? /= ?; exact/coarseT/ctsf. exists (cst 1); split => //; first exact: cst_continuous. by move=> ? [? _ <-]/=; rewrite bound_itvE. @@ -146,15 +146,15 @@ Qed. End urysohn_facts. End topological_urysohn_separator. -Lemma uniform_separatorW {T : uniformType} (A B : set T) : +Lemma uniform_separatorW {d} {T : uniformType d} (A B : set T) : (exists2 E, entourage E & A `*` B `&` E = set0) -> uniform_separator A B. -Proof. by case=> E entE AB0; exists (Uniform.class T), E; split => // ?. Qed. +Proof. by case=> E entE AB0; exists d, (Uniform.class T), E; split => // ?. Qed. Section Urysohn. Local Open Scope relation_scope. -Context {T : topologicalType}. -Hypothesis normalT : normal_space T. +Context {d} {T : topologicalType d}. +Hypothesis normalT : normal_space d T. Section normal_uniform_separators. Context (A : set T). @@ -208,7 +208,7 @@ Local Lemma ury_base_split E : ury_base E -> Proof. case; case => L R [/= oL oR AL cLR <-]. have [R' []] : exists R', [/\ open R', closure L `<=` R' & closure R' `<=` R]. - have := @normalT (closure L) (@closed_closure T L). + have := @normalT (closure L) (@closed_closure _ T L). case/(_ R); first by move=> x /cLR ?; apply: open_nbhs_nbhs. move=> V /set_nbhsP [U] [? ? ? cVR]; exists U; split => //. by apply: (subset_trans _ cVR); exact: closureS. @@ -279,10 +279,10 @@ Definition urysohnType : Type := T. HB.instance Definition _ := Choice.on urysohnType. -HB.instance Definition _ := - isUniform.Build urysohnType ury_unif_filter ury_unif_refl ury_unif_inv - ury_unif_split. -HB.instance Definition _ {p : Pointed T} := Pointed.copy urysohnType (Pointed.Pack p). +HB.instance Definition _ := isUniform.Build default_fdisp urysohnType + ury_unif_filter ury_unif_refl ury_unif_inv ury_unif_split. +HB.instance Definition _ {p : Pointed T} := + Pointed.copy urysohnType (Pointed.Pack p). Lemma normal_uniform_separator (B : set T) : closed A -> closed B -> A `&` B = set0 -> uniform_separator A B. @@ -292,7 +292,8 @@ move=> clA clB AB0; have /(_ (~`B))[x Ax|] := normalT clA. - exact/closed_openC. - by move: x Ax; apply/ disjoints_subset. move=> V /set_nbhsP [U [oU AU UV]] cVcb. -exists (Uniform.class urysohnType), (apxU (U, ~` B)); split => //. +exists default_fdisp, (Uniform.class urysohnType), (apxU (U, ~` B)). +split => //. - move=> ?; apply:sub_gen_smallest; exists (U, ~`B) => //; split => //=. exact/closed_openC. by move: UV => /closureS/subset_trans; apply. @@ -300,7 +301,7 @@ exists (Uniform.class urysohnType), (apxU (U, ~` B)); split => //. by have /subset_closure ? := AU _ Aa; case. move=> x ? [E gE] /(@filterS T); apply; move: gE. rewrite /= /ury_unif filterI_iterE; case => K /= [i _] /= uiK KE. -suff : @nbhs T T x [set y | K (x, y)] by apply: filterS => y /KE/xsectionP. +suff : @nbhs _ T T x [set y | K (x, y)] by apply: filterS => y /KE/xsectionP. elim: i K uiK {E KE}; last by move=> ? H ? [N] /H ? [M] /H ? <-; apply: filterI. move=> K [->|]; first exact: filterT. move=> [[/= P Q] [/= oP oQ AP cPQ <-]]; rewrite /apxU /=. @@ -323,7 +324,8 @@ Qed. End normal_uniform_separators. End Urysohn. -Lemma uniform_separatorP {T : topologicalType} {R : realType} (A B : set T) : +Lemma uniform_separatorP {d} {T : topologicalType d} + {R : realType} (A B : set T) : uniform_separator A B <-> exists (f : T -> R), [/\ continuous f, range f `<=` `[0, 1], f @` A `<=` [set 0] & f @` B `<=` [set 1]]. @@ -334,7 +336,8 @@ split; first do [move=> ?; exists (Urysohn A B); split]. - exact: Urysohn_sub0. - exact: Urysohn_sub1. case=> f [ctsf f01 fA0 fB1]. -pose T' : uniformType := initial_topology f. +pose T' : uniformType _ := initial_topology f. +eexists. exists (Uniform.class T'), ([set xy | ball (f xy.1) 1 (f xy.2)]); split. - exists [set xy | ball xy.1 1 xy.2]; last by case. by rewrite -entourage_ballE; exists 1 => //=. @@ -345,19 +348,19 @@ exists (Uniform.class T'), ([set xy | ball (f xy.1) 1 (f xy.2)]); split. Qed. Section normalP. -Context {R : realType} {T : topologicalType}. +Context {d} {R : realType} {T : topologicalType d}. (* Ideally, R should be an instance of realType here, rather than a section variable. *) Let normal_spaceP : [<-> - (* 0 *) normal_space T; + (* 0 *) normal_space d T; (* 1 *) forall (A B : set T), closed A -> closed B -> A `&` B = set0 -> uniform_separator A B; (* 2 *) forall (A B : set T), closed A -> closed B -> A `&` B = set0 -> exists U V, [/\ open U, open V, A `<=` U, B `<=` V & U `&` V = set0] ]. Proof. tfae; first by move=> ?; exact: normal_uniform_separator. -- move=> + A B clA clB AB0 => /(_ _ _ clA clB AB0) /(@uniform_separatorP _ R). +- move=> + A B clA clB AB0 => /(_ _ _ clA clB AB0) /(@uniform_separatorP _ _ R). case=> f [cf f01 /imsub1P/subset_trans fa0 /imsub1P/subset_trans fb1]. exists (f@^-1` `]-1, 1/2[), (f @^-1` `]1/2, 2[); split. + by apply: open_comp; [|exact: interval_open]. @@ -379,12 +382,12 @@ apply/subsetCr; have := open_closedC oV; rewrite closure_id => ->. exact/closureS/subsetC/subset_closure. Qed. -Lemma normal_openP : normal_space T <-> +Lemma normal_openP : normal_space d T <-> forall (A B : set T), closed A -> closed B -> A `&` B = set0 -> exists U V, [/\ open U, open V, A `<=` U, B `<=` V & U `&` V = set0]. Proof. exact: (normal_spaceP 0%N 2%N). Qed. -Lemma normal_separatorP : normal_space T <-> +Lemma normal_separatorP : normal_space d T <-> forall (A B : set T), closed A -> closed B -> A `&` B = set0 -> uniform_separator A B. Proof. exact: (normal_spaceP 0%N 1%N). Qed. @@ -402,32 +405,32 @@ Context {R : realType}. If you don't care, you can use the `completely_regular_uniformity.type` which builds the uniformity. *) -Definition completely_regular_space (T : topologicalType) := +Definition completely_regular_space d (T : topologicalType d) := forall (a : T) (B : set T), closed B -> ~ B a -> uniform_separator [set a] B. -Lemma point_uniform_separator {T : uniformType} (x : T) (B : set T) : +Lemma point_uniform_separator {d} {T : uniformType d} (x : T) (B : set T) : closed B -> ~ B x -> uniform_separator [set x] B. Proof. move=> clB nBx; have : open (~` B) by rewrite openC. rewrite openE => /(_ _ nBx); rewrite /interior /= -nbhs_entourageE. case=> E entE EnB. -pose T' : pseudoMetricType R := gauge.type entE. -exists (Uniform.class T); exists E; split => //; last by move => ?. +pose T' : pseudoMetricType _ R := gauge.type entE. +eexists; exists (Uniform.class T), E; split => //; last by move => ?. by rewrite -subset0 => -[? w [/= [-> ? /xsectionP ?]]]; exact: (EnB w). Qed. -Lemma uniform_completely_regular {T : uniformType} : - @completely_regular_space T. +Lemma uniform_completely_regular {d} {T : uniformType d} : + @completely_regular_space d T. Proof. by move=> x B clB Bx; exact: point_uniform_separator. Qed. -Lemma normal_completely_regular {T : topologicalType} : - normal_space T -> accessible_space T -> completely_regular_space T. +Lemma normal_completely_regular {d} {T : topologicalType d} : + normal_space d T -> accessible_space T -> completely_regular_space T. Proof. move/normal_separatorP => + /accessible_closed_set1 cl1 x A ? ?; apply => //. by apply/disjoints_subset => ? ->. Qed. -Lemma uniform_regular {X : uniformType} : @regular_space X. +Lemma uniform_regular {d} {X : uniformType d} : @regular_space d X. Proof. move=> x A; rewrite /= -nbhs_entourageE => -[E entE]. move/(subset_trans (ent_closure entE)) => ExA. @@ -438,20 +441,20 @@ End completely_regular. Module completely_regular_uniformity. Section completely_regular_uniformity. -Context {R : realType} {X : topologicalType}. +Context {d} {R : realType} {X : topologicalType d}. Hypothesis crs : completely_regular_space X. -Let X' : uniformType := @sup_topology X {f : X -> R | continuous f} +Let X' : uniformType _ := @sup_topology X {f : X -> R | continuous f} _ (fun f => Uniform.class (initial_topology (projT1 f))). -Let completely_regular_nbhsE : @nbhs X X = nbhs_ (@entourage X'). +Let completely_regular_nbhsE : @nbhs _ X X = nbhs_ (@entourage _ X'). Proof. rewrite nbhs_entourageE; apply/funext => x; apply/seteqP; split; first last. apply/cvg_sup => -[f ctsf] U [/= _ [[V /= oV <- /= Vfx]]] /filterS. by apply; exact/ctsf/open_nbhs_nbhs. -move=> U; wlog oU : U / @open X U. +move=> U; wlog oU : U / @open _ X U. move=> WH; rewrite nbhsE => -[V [oV Vx /filterS]]. - apply; first exact: (@nbhs_filter X'). + apply; first exact: (@nbhs_filter _ X'). by apply: WH => //; move: oV; rewrite openE; exact. move=> /[dup] nUx /nbhs_singleton Ux. have ufs : uniform_separator [set x] (~` U). @@ -467,7 +470,7 @@ exists E; first last. by apply: fU1; exists z. move=> r /= [_]; apply => /=. pose f' : {classic {f : X -> R | continuous f}} := exist _ f ctsf. -suff /asboolP entE : @entourage (initial_topology f) (f', E).2. +suff /asboolP entE : @entourage _ (initial_topology f) (f', E).2. by exists (exist _ (f', E) entE). exists (fun pq => ball pq.1 1 pq.2) => //=. by rewrite /entourage /=; exists 1 => /=. @@ -477,12 +480,12 @@ Definition type : Type := let _ := completely_regular_nbhsE in X. #[export] HB.instance Definition _ := Topological.copy type X. #[export] HB.instance Definition _ := @Nbhs_isUniform.Build - type - (@entourage X') - (@entourage_filter X') - (@entourage_diagonal_subproof X') - (@entourage_inv X') - (@entourage_split_ex X') + _ type + (@entourage _ X') + (@entourage_filter _ X') + (@entourage_diagonal_subproof _ X') + (@entourage_inv _ X') + (@entourage_split_ex _ X') completely_regular_nbhsE. (*#[export] HB.instance Definition _ := Uniform.on type.*) (* generates Warning: HB: no new instance is generated [HB.no-new-instance,HB,elpi,default] *) @@ -493,7 +496,7 @@ End completely_regular_uniformity. Export completely_regular_uniformity.Exports. Section locally_compact_uniform. -Context {X : topologicalType} {R : realType}. +Context {d} {X : topologicalType d} {R : realType}. Hypothesis lcpt : locally_compact [set: X]. Hypothesis hsdf : hausdorff_space X. @@ -511,23 +514,24 @@ Qed. #[local] HB.instance Definition _ := Uniform.copy opc - (@completely_regular_uniformity.type R _ + (@completely_regular_uniformity.type _ R _ one_point_compactification_completely_reg). Let X' := @initial_topology X opc Some. -Lemma nbhs_one_point_compactification_weakE : @nbhs X X = nbhs_ (@entourage X'). +Lemma nbhs_one_point_compactification_weakE : + @nbhs _ X X = nbhs_ (@entourage _ X'). Proof. by rewrite nbhs_entourageE one_point_compactification_initial_topology. Qed. #[local, non_forgetful_inheritance] HB.instance Definition _ := @Nbhs_isUniform.Build - X - (@entourage X') - (@entourage_filter X') - (@entourage_diagonal_subproof X') - (@entourage_inv X') - (@entourage_split_ex X') + _ X + (@entourage _ X') + (@entourage_filter _ X') + (@entourage_diagonal_subproof _ X') + (@entourage_inv _ X') + (@entourage_split_ex _ X') nbhs_one_point_compactification_weakE. Lemma locally_compact_completely_regular : completely_regular_space X. @@ -535,17 +539,17 @@ Proof. exact: uniform_completely_regular. Qed. End locally_compact_uniform. -Lemma completely_regular_regular {R : realType} {X : topologicalType} : - completely_regular_space X -> @regular_space X. +Lemma completely_regular_regular {d} {R : realType} {X : topologicalType d} : + completely_regular_space X -> @regular_space _ X. Proof. -move=> crsX; pose P' := @completely_regular_uniformity.type R _ crsX. -exact: (@uniform_regular P'). +move=> crsX; pose P' := @completely_regular_uniformity.type _ R _ crsX. +exact: (@uniform_regular _ P'). Qed. Section pseudometric_normal. -Lemma regular_openP {T : topologicalType} (x : T) : - {for x, @regular_space T} <-> forall A, closed A -> ~ A x -> +Lemma regular_openP {d} {T : topologicalType d} (x : T) : + {for x, @regular_space d T} <-> forall A, closed A -> ~ A x -> exists U V : set T, [/\ open U, open V, U x, A `<=` V & U `&` V = set0]. Proof. split. @@ -555,7 +559,7 @@ split. exists (~` closure U) ; split => //; first exact: open_interior. exact/closed_openC/closed_closure. apply/disjoints_subset; rewrite setCK. - exact: (subset_trans (@interior_subset _ _) (@subset_closure _ _)). + exact: (subset_trans (@interior_subset _ _ _) (@subset_closure _ _ _)). move=> + A Ax => /(_ (~` A°)) []; [|exact|]. exact/open_closedC/open_interior. move=> U [V] [oU oV Ux /subsetC cAV /disjoints_subset UV]; exists U. @@ -565,14 +569,14 @@ move/open_closedC/closure_id : oV => <-. by apply: (subset_trans cAV); rewrite setCK; exact: interior_subset. Qed. -Lemma pseudometric_normal {R : realType} {X : pseudoMetricType R} : - normal_space X. +Lemma pseudometric_normal {d} {R : realType} {X : pseudoMetricType d R} : + normal_space d X. Proof. -apply/(@normal_openP R) => A B clA clB AB0. +apply/(@normal_openP _ R) => A B clA clB AB0. have eps' (D : set X) : closed D -> forall x, exists eps : {posnum R}, ~ D x -> ball x eps%:num `&` D = set0. move=> clD x; have [nDx|?] := pselect (~ D x); last by exists 1%:pos. - have /regular_openP/(_ _ clD) [//|] := @uniform_regular X x. + have /regular_openP/(_ _ clD) [//|] := @uniform_regular _ X x. move=> U [V] [+ oV] Ux /subsetC BV /disjoints_subset UV0. rewrite openE /interior => /(_ _ Ux); rewrite -nbhs_ballE => -[]. move => _/posnumP[eps] beU; exists eps => _; apply/disjoints_subset. diff --git a/theories/normedtype_theory/vitali_lemma.v b/theories/normedtype_theory/vitali_lemma.v index 8c75dc07ff..c7bb69a63c 100644 --- a/theories/normedtype_theory/vitali_lemma.v +++ b/theories/normedtype_theory/vitali_lemma.v @@ -46,7 +46,7 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section center_radius. -Context {R : numDomainType} {M : pseudoPMetricType R}. +Context {d} {R : numDomainType} {M : pseudoPMetricType d R}. Implicit Types A : set M. (* NB: the identifier "center" is already taken! *) diff --git a/theories/numfun.v b/theories/numfun.v index 448bb9c0c6..8ec0fc0895 100644 --- a/theories/numfun.v +++ b/theories/numfun.v @@ -1170,7 +1170,7 @@ Lemma cvg_indic {R : realFieldType} (x : R^o) k : x \in (ball 0 k : set R^o) -> \1_(ball 0 k : set R^o) y @[y --> x] --> (\1_(ball 0 k) x : R). Proof. -move=> xB; apply/(@cvgrPdist_le _ R^o) => /= e e0; near=> t. +move=> xB; apply/(@cvgrPdist_le _ _ R^o) => /= e e0; near=> t. rewrite !indicE xB/= mem_set//=; last by rewrite subrr normr0// ltW. near: t. rewrite inE /ball /= sub0r normrN in xB. @@ -1262,9 +1262,9 @@ HB.builders Context T R f & @FiniteDecomp T R f. HB.end. Section Tietze. -Context {X : topologicalType} {R : realType}. +Context {d} {X : topologicalType d} {R : realType}. -Hypothesis normalX : normal_space X. +Hypothesis normalX : normal_space d X. Lemma urysohn_ext_itv A B x y : closed A -> closed B -> A `&` B = set0 -> x < y -> @@ -1272,12 +1272,13 @@ Lemma urysohn_ext_itv A B x y : f @` A `<=` [set x], f @` B `<=` [set y] & range f `<=` `[x, y]]. Proof. move=> cA cB A0 xy; move/normal_separatorP : normalX => urysohn_ext. -have /(@uniform_separatorP _ R)[f [cf f01 f0 f1]] := urysohn_ext R _ _ cA cB A0. +have /(@uniform_separatorP _ _ R)[f [cf f01 f0 f1]] + := urysohn_ext R _ _ cA cB A0. pose g : X -> R := line_path x y \o f; exists g; split; rewrite /g /=. move=> t; apply: continuous_comp; first exact: cf. - apply: (@continuousD R R^o). + apply: (@continuousD _ _ R R^o). apply: continuousM; last exact: cst_continuous. - by apply: (@continuousB _ R^o) => //; exact: cst_continuous. + by apply: (@continuousB _ _ _ R^o) => //; exact: cst_continuous. by apply: continuousM => //; exact: cst_continuous. - by rewrite -image_comp => z /= [? /f0 -> <-]; rewrite line_path0. - by rewrite -image_comp => z /= [? /f1 -> <-]; rewrite line_path1. @@ -1389,18 +1390,18 @@ have cvgh : {uniform, h_ @ \oo --> lim (h_ @ \oo)}. exists (lim (h_ @ \oo)); split. - move=> t /set_mem At; have /pointwise_cvgP/(_ t)/(cvg_lim (@Rhausdorff _)) := [elaborate pointwise_uniform_cvg _ cvgh]. - rewrite -fmap_comp /comp /h_ => <-; apply/esym/(@cvg_lim _ (@Rhausdorff R)). - apply: (@cvg_zero _ R^o); apply: norm_cvg0; under eq_fun => n. + rewrite -fmap_comp /comp /h_ => <-; apply/esym/(@cvg_lim _ _ (@Rhausdorff R)). + apply: (@cvg_zero _ _ R^o); apply: norm_cvg0; under eq_fun => n. rewrite distrC /series /cst /= -mulN1r fct_sumE mulr_sumr. under [fun _ : nat => _]eq_fun => ? do rewrite mulN1r -fgE opprB. rewrite telescope_sumr //= subrKC. over. apply/norm_cvg0P/cvgr0Pnorm_lt => eps epos. - have /(_ _ epos) := @cvgr0_norm_lt R _ _ _ eventually_filter (_ : nat -> R^o) - (cvg_geometric M%:num twothirds1). + have /(_ _ epos) := @cvgr0_norm_lt _ R _ _ _ + eventually_filter (_ : nat -> R^o) (cvg_geometric M%:num twothirds1). apply: filter_app; near_simpl; apply: nearW => n /le_lt_trans; apply. by rewrite (le_trans ((f_geo n).2 _ _)) // ler_norm. -- apply: (@uniform_limit_continuous X _ (h_ @ \oo) (lim (h_ @ \oo))) =>//. +- apply: (@uniform_limit_continuous _ _ X _ (h_ @ \oo) (lim (h_ @ \oo))) => //. near_simpl; apply: nearW; elim. by rewrite /h_ /series /= big_geq// => ?; exact: cst_continuous. move=> n; rewrite /h_ /series /= big_nat_recr /= // => IH t. diff --git a/theories/probability_theory/beta_distribution.v b/theories/probability_theory/beta_distribution.v index 913b38a58c..0b7ea2b104 100644 --- a/theories/probability_theory/beta_distribution.v +++ b/theories/probability_theory/beta_distribution.v @@ -45,8 +45,8 @@ Implicit Types x y : R. Lemma continuous_onemXn n x : {for x, continuous (fun y => y.~ ^+ n)}. Proof. -apply: (@continuous_comp _ _ _ (@onem R) (fun x => x ^+ n)). - exact: (@cvgB _ R^o). +apply: (@continuous_comp _ _ _ _ _ _ (@onem R) (fun x => x ^+ n)). + exact: (@cvgB _ _ R^o). exact: exprn_continuous. Qed. @@ -54,7 +54,7 @@ Import MeasurableR. Lemma onemXn_derivable n x : derivable (fun y => y.~ ^+ n) x 1. Proof. -have := @derivableX _ _ (@onem R) n x 1. +have := @derivableX _ _ _ (@onem R) n x 1. by rewrite fctE; apply; exact: derivableB. Qed. diff --git a/theories/probability_theory/exponential_distribution.v b/theories/probability_theory/exponential_distribution.v index 2b8a6d49b8..987abc62e3 100644 --- a/theories/probability_theory/exponential_distribution.v +++ b/theories/probability_theory/exponential_distribution.v @@ -49,10 +49,11 @@ Qed. Let continuous_exponential_pdfT : continuous exponential_pdfT. Proof. move=> x. -apply: (@continuousM _ R^o (fun=> rate) (fun x => expR (- rate * x))). +apply: (@continuousM _ _ R^o (fun=> rate) (fun x => expR (- rate * x))). exact: cst_continuous. apply: continuous_comp; last exact: continuous_expR. -by apply: continuousM => //; apply: (@continuousN _ R^o); exact: cst_continuous. +by apply: continuousM => //; apply: (@continuousN _ _ _ R^o) + ; exact: cst_continuous. Qed. Import MeasurableR. @@ -115,7 +116,8 @@ Qed. Let cexpNM : continuous (fun z : R^o => expR (- rate * z)). Proof. move=> z; apply: continuous_comp; last exact: continuous_expR. -by apply: continuousM => //; apply: (@continuousN _ R^o); exact: cst_continuous. +by apply: continuousM => //; apply: (@continuousN _ _ _ R^o) + ; exact: cst_continuous. Qed. Lemma exponential_prob_itv0c (x : R) : 0 < x -> @@ -126,7 +128,7 @@ rewrite (_ : 1 = - (- expR (- rate * 0))%:E)%E. by rewrite mulr0 expR0 EFinN oppeK. rewrite addeC. apply: (@continuous_FTC2 _ _ (fun x => - expR (- rate * x))) => //. -- apply: (@continuous_subspaceW R^o _ _ [set` `[0, +oo[%R]). +- apply: (@continuous_subspaceW _ _ R^o _ _ [set` `[0, +oo[%R]). + exact: subset_itvl. + exact: within_continuous_exponential_pdf. - split. diff --git a/theories/probability_theory/random_variable.v b/theories/probability_theory/random_variable.v index efebbbfa82..1f0798ff65 100644 --- a/theories/probability_theory/random_variable.v +++ b/theories/probability_theory/random_variable.v @@ -371,7 +371,7 @@ have cdf_na : cdf X (a + n.+1%:R^-1) @[n --> \oo] --> cdf X a. by rewrite -(cvg_unique _ cdf_ns cdf_na). Unshelve. all: by end_near. Qed. -HB.instance Definition _ := isCumulative.Build R _ (\bar R) (cdf X) +HB.instance Definition _ := isCumulative.Build R _ _ (\bar R) (cdf X) cdf_nondecreasing cdf_right_continuous. End cumulative_distribution_function. @@ -432,7 +432,7 @@ by rewrite fineK ?fin_num_measure//; exact: cdf_right_continuous. Qed. #[local] HB.instance Definition _ := - isCumulative.Build R _ R fcdf fcdf_nd fcdf_rc. + isCumulative.Build R _ _ R fcdf fcdf_nd fcdf_rc. Let fcdf_Ny0 : fcdf @ -oo --> (0:R). Proof. exact/fine_cvg/cvg_cdfNy0. Qed. diff --git a/theories/real_measure/lebesgue_stieltjes_measure.v b/theories/real_measure/lebesgue_stieltjes_measure.v index 0ddbb8bffd..0621ee578a 100644 --- a/theories/real_measure/lebesgue_stieltjes_measure.v +++ b/theories/real_measure/lebesgue_stieltjes_measure.v @@ -94,38 +94,39 @@ Import numFieldTopology.Exports. Local Open Scope classical_set_scope. Local Open Scope ring_scope. -Reserved Notation "R .-ocitv" (at level 1, format "R .-ocitv"). +Reserved Notation "R .-ocitv" (at level 5, format "R .-ocitv"). Reserved Notation "R .-ocitv.-measurable" - (at level 2, format "R .-ocitv.-measurable"). -Reserved Notation "R .-open" (at level 1, format "R .-open"). + (at level 6, format "R .-ocitv.-measurable"). +Reserved Notation "R .-open" (at level 5, format "R .-open"). Reserved Notation "R .-open.-measurable" - (at level 2, format "R .-open.-measurable"). + (at level 6, format "R .-open.-measurable"). Notation right_continuous f := (forall x, f%function @ at_right x --> f%function x). -Lemma right_continuousW (R : numFieldType) {d} (U : orderNbhsType d) +Lemma right_continuousW (R : numFieldType) {td od} (U : orderNbhsType td od) (f : R -> U) : continuous f -> right_continuous f. Proof. by move=> cf x; apply: cvg_within_filter; exact/cf. Qed. -HB.mixin Record isCumulative (R : numFieldType) {d} (U : orderNbhsType d) - (f : R -> U) := { +HB.mixin Record isCumulative (R : numFieldType) {td od} + (U : orderNbhsType td od) (f : R -> U) := { cumulative_is_nondecreasing : nondecreasing f ; cumulative_is_right_continuous : right_continuous f }. #[short(type=cumulative)] HB.structure Definition Cumulative - (R : numFieldType) {d} (U : orderNbhsType d) := { f of isCumulative R d U f }. + (R : numFieldType) {td od} (U : orderNbhsType td od) := + { f of isCumulative R td od U f }. -Arguments cumulative_is_nondecreasing {R d U} _. -Arguments cumulative_is_right_continuous {R d U} _. +Arguments cumulative_is_nondecreasing {R td od U} _. +Arguments cumulative_is_right_continuous {R td od U} _. Lemma nondecreasing_right_continuousP (R : realFieldType) (a : R) (e : R) (f : cumulative R R) : e > 0 -> exists d : {posnum R}, f (a + d%:num) <= f a + e. Proof. move=> e0; move: (cumulative_is_right_continuous f). -move=> /(_ a) /(@cvgr_dist_lt _ R^o) /(_ _ e0)[] _ /posnumP[d] => h. +move=> /(_ a) /(@cvgr_dist_lt _ _ R^o) /(_ _ e0)[] _ /posnumP[d] => h. exists (PosNum [gt0 of (d%:num / 2)]) => //=. move: h => /(_ (a + d%:num / 2)) /=. rewrite opprD addNKr normrN ger0_norm// ltr_pdivrMr// ltr_pMr// 2!ltrDl. @@ -144,7 +145,7 @@ Proof. by []. Qed. Let id_rc : right_continuous (@idfun R). Proof. by apply/right_continuousW => x; exact: cvg_id. Qed. -HB.instance Definition _ := isCumulative.Build R _ R idfun id_nd id_rc. +HB.instance Definition _ := isCumulative.Build R _ _ R idfun id_nd id_rc. End id_is_cumulative. HB.mixin Record isCumulativeBounded (R : numFieldType) (l r : R) (f : R -> R) := { @@ -470,7 +471,8 @@ Definition open_type : Type := R. HB.instance Definition _ := Pointed.on open_type. -Let measurable : set_system R := @measurable _ (g_sigma_algebraType (@open R)). +Let measurable : set_system R := + @measurable _ (g_sigma_algebraType (@open _ R)). Let measurable0 : measurable set0. Proof. exact: measurable0. Qed. @@ -482,12 +484,12 @@ Let measurable_bigcup (F : (set R)^nat) : (forall i, measurable (F i)) -> Proof. move=> mF; exact: bigcupT_measurable. Qed. HB.instance Definition _ := - @isMeasurable.Build (sigma_display (@open R)) + @isMeasurable.Build (sigma_display (@open _ R)) open_type measurable measurable0 measurableC measurable_bigcup. End open. -Notation "R .-open" := (sigma_display (@open R)) : measure_display_scope. +Notation "R .-open" := (sigma_display (@open _ R)) : measure_display_scope. Notation "R .-open.-measurable" := (measurable : set_system (@open_type R)) : classical_set_scope. @@ -495,7 +497,7 @@ Module MeasurableRopen. Section measurableRopen. Context {R : realType}. -Definition measurableTypeR := g_sigma_algebraType (@open R). +Definition measurableTypeR := g_sigma_algebraType (@open _ R). Definition lebesgue_display : measure_display := R.-open. @@ -868,7 +870,7 @@ apply: (@le_trans _ _ (\sum_(i <- X) (wlength f `](b i).1, (b i).2]%classic) + rewrite addeC -big_split/=; apply: lee_sum => k _. by rewrite !(EFinB, wlength_itv_bnd)// addeA subeK. rewrite -big_split/= nneseries_esum//; first by move=> k _; rewrite adde_ge0. -rewrite esum_ge//=; first by move=> n _; rewrite adde_ge0. +rewrite esum_ge//=; first by [move=> n _; rewrite adde_ge0]. exists [set` X] => //; rewrite fsbig_finite//= set_fsetK. rewrite big_seq [in X in (_ <= X)%E]big_seq; apply: lee_sum => k kX. by rewrite AE leeD2l// lee_fin lerBlDl natrX De. @@ -905,7 +907,7 @@ HB.instance Definition _ (f : cumulative R R) := (ocitv_sigmaT_finite_lebesgue_stieltjes_measure f). Definition lebesgue_stieltjes_measure (f : cumulative R R) : - set (g_sigma_algebraType (@open R)) -> \bar R := + set (g_sigma_algebraType (@open _ R)) -> \bar R := measure_extension (wlength f). Let lsm0 (f : cumulative R R) : lebesgue_stieltjes_measure f set0 = 0. diff --git a/theories/realfun.v b/theories/realfun.v index 65c083265f..86ce22bfac 100644 --- a/theories/realfun.v +++ b/theories/realfun.v @@ -111,7 +111,7 @@ Lemma cvg_addrl_Ny (M : R) : M + r @[r --> -oo] --> -oo. Proof. by under eq_fun do rewrite addrC; exact: cvg_addrr_Ny. Qed. (* NB: see cvg_centern in sequences.v *) -Lemma cvg_centerr (M : R) (T : topologicalType) (f : R -> T) (l : T) : +Lemma cvg_centerr d (M : R) (T : topologicalType d) (f : R -> T) (l : T) : (f (n - M) @[n --> +oo] --> l) = (f r @[r --> +oo] --> l). Proof. rewrite propeqE; split; last by apply: cvg_comp; exact: cvg_addrr. @@ -122,7 +122,7 @@ by under [X in X @ _ --> l]funext => n do rewrite addrK. Qed. (* NB: see cvg_shiftn in sequence.v *) -Lemma cvg_shiftr (M : R) (T : topologicalType) (f : R -> T) (l : T) : +Lemma cvg_shiftr d (M : R) (T : topologicalType d) (f : R -> T) (l : T) : (f (n + M) @[n --> +oo]--> l) = (f r @[r --> +oo] --> l). Proof. rewrite propeqE; split; last by apply: cvg_comp; exact: cvg_addrr. @@ -1023,7 +1023,7 @@ Qed. End lime_sup_inf. Section derivable_oo_LRcontinuous. -Context {R : numFieldType} {V : normedModType R}. +Context {d} {R : numFieldType} {V : normedModType d R}. Definition derivable_oo_LRcontinuous (f : R -> V) (x y : R) := [/\ {in `]x, y[, forall x, derivable f x 1}, @@ -1097,7 +1097,7 @@ Notation derivable_oy_continuous_within_itvcy := derivable_oy_Rcontinuous_within Notation derivable_Noy_continuous_within_itvNyc := derivable_Noy_Lcontinuous_within_itvNyc (only parsing). Section derivable_oo_continuousW. -Context {R : realFieldType} {V : normedModType R}. +Context {td} {R : realFieldType} {V : normedModType td R}. Lemma derivable_oo_continuousW (a b c d : R) (f : R -> V) : c < d -> @@ -1493,7 +1493,8 @@ move=> aLb fC fK x y xfbfa yfbfa; rewrite -lerN2. apply: (@segment_can_le (- b) (- a) (f \o -%R) (- g)); rewrite /= ?lerN2 ?opprK //. pose fun_neg : subspace `[-b,-a] -> subspace `[a,b] := itvN_oppr a b. - move=> z; apply: (@continuous_comp _ _ _ [fun of fun_neg]); last exact: fC. + move=> z. + apply: (@continuous_comp _ _ _ _ _ _ [fun of fun_neg]); last exact: fC. exact/subspaceT_continuous/continuous_subspaceT/oppr_continuous. by move=> z zab; rewrite -[- g]/(@GRing.opp _ \o g)/= fK ?opprK// oppr_itvcc. Qed. @@ -2592,8 +2593,8 @@ have [r] := MVT ab gdg cg; rewrite in_itv/= => /andP[ar rb] dgg. pose h (x : R) := f x - ((f b - f a) / (g b - g a)) * g x. have hder x : x \in `]a, b[%R -> derivable h x 1. move=> xab; apply: derivableB => /=. - exact: (@ex_derive _ _ _ _ _ _ _ (fdf xab)). - by apply: derivableM => //; exact: (@ex_derive _ _ _ _ _ _ _ (gdg xab)). + exact: (@ex_derive _ _ _ _ _ _ _ _ _ (fdf xab)). + by apply: derivableM => //; exact: (@ex_derive _ _ _ _ _ _ _ _ _ (gdg xab)). have ch : {within `[a, b], continuous h}. rewrite continuous_subspace_in => x xab. by apply: cvgB; [exact: cf|apply: cvgM => //; exact: cg]. @@ -2604,8 +2605,8 @@ pose dh (x : R) := df x - (f b - f a) / (g b - g a) * dg x. have his_der y : y \in `]a, b[%R -> is_derive x 1 h (dh x). by move=> yab; apply: is_deriveB; [exact: fdf|apply: is_deriveZ; exact: gdg]. exists x => //. -have := @derive_val _ R _ _ _ _ _ (his_der _ xab). -have -> := @derive_val _ R _ _ _ _ _ derh. +have := @derive_val _ _ _ R _ _ _ _ _ (his_der _ xab). +have -> := @derive_val _ _ _ R _ _ _ _ _ derh. by move=> /eqP; rewrite eq_sym subr_eq add0r => /eqP ->; rewrite mulfK // dg0. Qed. @@ -2656,7 +2657,7 @@ Let g0 x := if x == a then 0 else g x. Let g0dg z y : y <= b -> z \in `]a, y[ -> is_derive z 1 g0 (dg z). Proof. -move=> yb zay; apply: (@near_eq_is_derive _ _ _ g) => //; last first. +move=> yb zay; apply: (@near_eq_is_derive _ _ _ _ _ g) => //; last first. by apply: gdg; move: z zay; apply: subset_itvSoo; rewrite bnd_simp. near=> u do rewrite /g0 gt_eqF//. by move: zay; rewrite in_itv/= => /andP[+ _]; exact: lt_nbhsr. @@ -3008,13 +3009,13 @@ near a^'+ => y; near=> x. have := @cauchy_MVT R f df g dg x y. have /[swap] /[apply] : x < y by []. have /[swap] /[apply] : {within `[x, y], continuous f}. - apply: (@continuous_subspaceW _ _ _ `]a, b[). + apply: (@continuous_subspaceW _ _ _ _ _ `]a, b[). by apply: subset_itv; rewrite bnd_simp. rewrite continuous_open_subspace// => /= z /set_mem/= z_ab. apply: differentiable_continuous; apply/derivable1_diffP. by apply: ex_derive; apply in_ab. have /[swap] /[apply] : {within `[x, y], continuous g}. - apply: (@continuous_subspaceW _ _ _ `]a, b[). + apply: (@continuous_subspaceW _ _ _ _ _ `]a, b[). by apply: subset_itv; rewrite bnd_simp. rewrite continuous_open_subspace// => /= z /set_mem/= z_ab. apply: differentiable_continuous; apply/derivable1_diffP. diff --git a/theories/sequences.v b/theories/sequences.v index 4893483e3b..f662a88d4f 100644 --- a/theories/sequences.v +++ b/theories/sequences.v @@ -345,8 +345,7 @@ Section sequences_patched. (* TODO: generalizations to numDomainType *) Section NatShift. - -Variables (N : nat) (V : ptopologicalType). +Context d (N : nat) (V : ptopologicalType d). Implicit Types (f : nat -> V) (u : V ^nat) (l : set_system V). Lemma cvg_restrict f u_ l : @@ -383,7 +382,7 @@ Unshelve. all: by end_near. Qed. End NatShift. -Variables (V : ptopologicalType). +Context d (V : ptopologicalType d). Lemma cvg_shiftS u_ (l : set_system V) : ([sequence u_ n.+1]_n @ \oo --> l) = (u_ @ \oo --> l). @@ -557,7 +556,7 @@ Lemma eq_sum_telescope (V : zmodType) (u_ : V ^nat) n : Proof. by rewrite telescopeK/= addrC addrNK. Qed. Section series_patched. -Context (N : nat) {K : numFieldType} {V : normedModType K}. +Context d (N : nat) {K : numFieldType} {V : normedModType d K}. Implicit Types (f : nat -> V) (u : V ^nat) (l : set_system V). Lemma is_cvg_series_restrict u_ : @@ -796,7 +795,7 @@ suff abel : forall n, rewrite funeqE => n; rewrite big_add1 /= /= big_distrr /=. by apply eq_bigr => i _; rewrite mulrCA mulrA. have {}a_o : [sequence n.+1%:R * telescope u_ n]_n @ \oo --> 0. - apply: (@eqolim0 _ _ _ eventually_filterType). + apply: (@eqolim0 _ _ _ _ eventually_filterType). rewrite a_o. set h := 'o_\oo (@harmonic R). apply/eqoP => _/posnumP[e] /=. @@ -849,7 +848,8 @@ End cesaro_converse. Section series_convergence. -Lemma cvg_series_cvg_0 (K : numFieldType) (V : normedModType K) (u_ : V ^nat) : +Lemma cvg_series_cvg_0 d (K : numFieldType) (V : normedModType d K) + (u_ : V ^nat) : cvgn (series u_) -> u_ @ \oo --> 0. Proof. move=> cvg_series. @@ -960,11 +960,11 @@ Lemma is_cvg_geometric_series (R : archiRealFieldType) (a z : R) : `|z| < 1 -> cvgn (series (geometric a z)). Proof. by move=> /cvg_geometric_series/cvgP; apply. Qed. -Definition normed_series_of (K : numDomainType) (V : normedModType K) +Definition normed_series_of d (K : numDomainType) (V : normedModType d K) (u_ : V ^nat) & phantom V^nat (series u_) : K ^nat := [series `|u_ n|]_n. -Notation "[ 'normed' s_ ]" := (@normed_series_of _ _ _ (Phantom _ s_)) : ring_scope. -Arguments normed_series_of {K V} u_ _ n /. +Notation "[ 'normed' s_ ]" := (@normed_series_of _ _ _ _ (Phantom _ s_)) : ring_scope. +Arguments normed_series_of {d K V} u_ _ n /. Lemma ger0_normed {K : numFieldType} (u_ : K ^nat) : (forall n, 0 <= u_ n) -> [normed series u_] = series u_. @@ -972,7 +972,8 @@ Proof. by move=> u_gt0; rewrite funeqE => n /=; apply: eq_bigr => k; rewrite ger0_norm. Qed. -Lemma cauchy_seriesP {R : numFieldType} (V : normedModType R) (u_ : V ^nat) : +Lemma cauchy_seriesP {d} {R : numFieldType} (V : normedModType d R) + (u_ : V ^nat) : cauchy (series u_ @ \oo) <-> forall e : R, e > 0 -> \forall n \near (\oo, \oo), `|\sum_(n.1 <= k < n.2) u_ k| < e. @@ -1018,7 +1019,8 @@ move: cvg_v => /(is_cvg_series_shiftn N); apply: series_squeeze_is_cvgn => /= n. by apply; exact: leq_addl. Unshelve. all: by end_near. Qed. -Lemma normed_cvg {R : realType} (V : completeNormedModType R) (u_ : V ^nat) : +Lemma normed_cvg {d} {R : realType} (V : completeNormedModType d R) + (u_ : V ^nat) : cvgn [normed series u_] -> cvgn (series u_). Proof. move=> /cauchy_cvgP/cauchy_seriesP u_ncvg. @@ -1027,7 +1029,8 @@ apply: filterS => n /=; rewrite ger0_norm ?sumr_ge0//. by apply: le_lt_trans; apply: ler_norm_sum. Qed. -Lemma lim_series_norm {R : realType} (V : completeNormedModType R) (f : V ^nat) : +Lemma lim_series_norm {d} {R : realType} (V : completeNormedModType d R) + (f : V ^nat) : cvgn [normed series f] -> `|limn (series f)| <= limn [normed series f]. Proof. @@ -1055,7 +1058,7 @@ move=> k0 kfK; have [K0|K0] := lerP K 0. near: x; exists (k / 2); first by rewrite /mkset divr_gt0. move=> t /=; rewrite distrC subr0 => tk2 t0. by rewrite normr_gt0 t0 (lt_trans tk2) // -[in ltLHS](add0r k) midf_lt. -- apply/(@eqolim0 _ _ R 0^')/eqoP => _/posnumP[e]; near=> x. +- apply/(@eqolim0 _ _ _ R 0^')/eqoP => _/posnumP[e]; near=> x. rewrite (le_trans (kfK _ _)) //=. + near: x; exists (k / 2); first by rewrite /mkset divr_gt0. move=> t /=; rewrite distrC subr0 => tk2 t0. @@ -1077,7 +1080,7 @@ have Cng : cvgn [normed series (g h)]. apply: series_squeeze_is_cvgn (Hg _ hLk) _ => [//|?|]. exact: le_trans (Hg _ hLk _). by under eq_fun do rewrite mulrC. -apply: (le_trans (@lim_series_norm _ R^o _ Cng)). +apply: (le_trans (@lim_series_norm _ _ R^o _ Cng)). rewrite -[_ * _](lim_seriesZ _ Cf) (lim_series_le Cng Ckf) // => n. by rewrite [leRHS]mulrC; exact: Hg. Qed. @@ -1163,7 +1166,7 @@ Lemma is_cvg_series_exp_coeff_pos : cvgn (series (exp x)). Proof. rewrite /series; near \oo => N; have xN : x < N%:R. by near: N; exists (truncn x).+1 => // m/= xm; rewrite -truncn_lt_nat// ltW. -rewrite -(@is_cvg_series_restrict N.+1). +rewrite -(@is_cvg_series_restrict _ N.+1). by apply: (nondecreasing_is_cvgn (incr_S1 N)); eexists; exact: S1_sup. Unshelve. all: by end_near. Qed. @@ -2715,7 +2718,7 @@ Lemma geometric_le_lim {R : realType} (n : nat) (a x : R) : 0 <= a -> 0 < x -> `|x| < 1 -> series (geometric a x) n <= a * (1 - x)^-1. Proof. move=> a0 x0 x1. -have /(@cvg_unique _ (@Rhausdorff R)) := @cvg_geometric_series _ a _ x1. +have /(@cvg_unique _ _ (@Rhausdorff R)) := @cvg_geometric_series _ a _ x1. move/(_ _ (@is_cvg_geometric_series _ a _ x1)) => ->. apply: nondecreasing_cvgn_le; last exact: is_cvg_geometric_series. by apply: nondecreasing_series => ? _ /=; rewrite pmulr_lge0 // exprn_gt0. @@ -3056,7 +3059,7 @@ apply: infinite_setIl => //. by apply: sub_finite_set (Dfin x) => y /=; case: leP. Qed. -Lemma finite_range_cvg_subsequence {T : ptopologicalType} (x_ : T ^nat) : +Lemma finite_range_cvg_subsequence {d} {T : ptopologicalType d} (x_ : T ^nat) : finite_set (range x_) -> exists2 f : nat -> nat, increasing_seq f & cvgn (x_ \o f). Proof. @@ -3085,7 +3088,7 @@ Qed. Section banach_contraction. -Context {R : realType} {X : completeNormedModType R} (U : set X). +Context {d} {R : realType} {X : completeNormedModType d R} (U : set X). Variables (f : {fun U >-> U}). Section contractions. @@ -3135,12 +3138,12 @@ suff : ball 0 (C^-1 * e%:num) (q%:num ^+ minn n.1 n.2). by rewrite /ball /= sub0r normrN ger0_norm. near: n; rewrite nbhs_simpl. pose g := fun w : nat * nat => q%:num ^+ minn w.1 w.2. -have := @fcvg_ball _ _ (g @ filter_prod \oo \oo) _ 0 _ (C^-1 * e%:num). +have := @fcvg_ball _ _ _ (g @ filter_prod \oo \oo) _ 0 _ (C^-1 * e%:num). move: (@cvg_geometric _ 1 q%:num); rewrite ger0_norm // => /(_ q1) geo. near_simpl; apply; last by rewrite mulr_gt0 // invr_gt0. apply/cvg_ballP => _/posnumP[delta]; near_simpl. have [N _ Q] : \forall N \near \oo, ball 0 delta%:num (geometric 1 q%:num N). - exact: (@fcvg_ball R R _ _ 0 geo). + exact: (@fcvg_ball _ R R _ _ 0 geo). exists ([set n | N <= n], [set n | N <= n])%N; first by split; exists N. move=> [n m] [Nn Nm]; rewrite /ball /= sub0r normrN ger0_norm /g //. apply: le_lt_trans; last by apply: (Q N) => /=. @@ -3183,7 +3186,7 @@ Section Baire. Variable K : realType. (* TODO: generalize to complete metric spaces *) -Theorem Baire (U : completeNormedModType K) (F : (set U)^nat) : +Theorem Baire d (U : completeNormedModType d K) (F : (set U)^nat) : (forall i, open (F i) /\ dense (F i)) -> dense (\bigcap_i (F i)). Proof. move=> odF D Dy OpenD. @@ -3200,7 +3203,7 @@ have Ar : forall na : nat * (U * {posnum K}), exists b : U * {posnum K}, move=> [n [an rn]]. have [ openFn denseFn] := odF n.+1. have [an1 B0Fn2an1] : exists x, ((closed_ball an rn%:num)° `&` F n.+1) x. - have [//|? ?] := @open_nbhs_closed_ball _ _ an rn%:num. + have [//|? ?] := @open_nbhs_closed_ball _ _ _ an rn%:num. by apply: denseFn => //; exists an. have openIB0Fn1 : open ((closed_ball an rn%:num)° `&` F n.+1). by apply/openI => //; exact/open_interior. @@ -3247,7 +3250,7 @@ have : cvg (a @ \oo). by rewrite -?ltr_pdivrMr ?mulfV ?ltr1n. rewrite cvg_ex //= => -[l Hl]; exists l; split. - have Hinter : (closed_ball a0 r0%:num) l. - apply: (@closed_cvg _ _ \oo eventually_filter a) => //. + apply: (@closed_cvg _ _ _ \oo eventually_filter a) => //. + exact: closed_ball_closed. + apply: nearW; move=> m; have /(_ (a m)) := @Suite_ball 0%N _ (leq0n m). by apply; exact: closed_ballxx. @@ -3255,8 +3258,9 @@ rewrite cvg_ex //= => -[l Hl]; exists l; split. by move: Ball_a0; rewrite closed_ballE //= subsetI; apply: proj1. - move=> i _. have : closed_ball (a i) (r i)%:num l. - rewrite -(@cvg_shiftn i _ a _) /= in Hl. - apply: (@closed_cvg _ _ \oo eventually_filter (fun n => a (n + i)%N)) => //=. + rewrite -(@cvg_shiftn _ i _ a _) /= in Hl. + apply: (@closed_cvg _ _ _ \oo eventually_filter (fun n => a (n + i)%N)) + => //=. + exact: closed_ball_closed. + by apply: nearW; move=> n; exact/(Suite_ball _ _ (leq_addl n i))/closed_ballxx. move: i => [|n]. @@ -3268,12 +3272,12 @@ Unshelve. all: by end_near. Qed. End Baire. (* TODO: generalize once PR#1107 is integrated *) -Definition bounded_fun_norm (K : realType) (V : normedModType K) - (W : normedModType K) (f : V -> W) := +Definition bounded_fun_norm d d' (K : realType) (V : normedModType d K) + (W : normedModType d' K) (f : V -> W) := forall r, exists M, forall x, `|x| <= r -> `|f x| <= M. -Lemma bounded_landau (K : realType) (V : normedModType K) - (W : normedModType K) (f : {linear V -> W}) : +Lemma bounded_landau d d' (K : realType) (V : normedModType d K) + (W : normedModType d' K) (f : {linear V -> W}) : bounded_fun_norm f <-> ((f : V -> W) =O_ (0 : V) cst (1:K)). Proof. rewrite eqOP; split => [|Bf]. @@ -3301,14 +3305,17 @@ Definition pointwise_bounded (K : realType) (V : normedModType K) (W : normedMod Definition uniform_bounded (K : realType) (V : normedModType K) (W : normedModType K) (F : set (V -> W)) := bounded_top F {uniform V -> W}. *) -Definition pointwise_bounded (K : realType) (V : normedModType K) (W : normedModType K) - (F : set (V -> W)) := forall x, exists M, forall f, F f -> `|f x| <= M. +Definition pointwise_bounded d d' (K : realType) (V : normedModType d K) + (W : normedModType d' K) (F : set (V -> W)) := + forall x, exists M, forall f, F f -> `|f x| <= M. -Definition uniform_bounded (K : realType) (V : normedModType K) (W : normedModType K) - (F : set (V -> W)) := forall r, exists M, forall f, F f -> forall x, `|x| <= r -> `|f x| <= M. +Definition uniform_bounded d d' (K : realType) (V : normedModType d K) + (W : normedModType d' K) (F : set (V -> W)) := + forall r, exists M, forall f, F f -> forall x, `|x| <= r -> `|f x| <= M. Section banach_steinhaus. -Variables (K : realType) (V : completeNormedModType K) (W : normedModType K). +Context d d' (K : realType) + (V : completeNormedModType d K) (W : normedModType d' K). Let pack_linear (f : V -> W) (lf : linear f) : {linear V -> W} := HB.pack f (GRing.isLinear.Build _ _ _ _ _ lf). @@ -3323,11 +3330,11 @@ move=> Propf BoundedF. set O := fun n => \bigcup_(f in F) (normr \o f)@^-1` [set y | y > n%:R]. have O_open : forall n, open ( O n ). move=> n; apply: bigcup_open => i Fi. - apply: (@open_comp _ _ (normr \o i) [set y | y > n%:R]); last first. + apply: (@open_comp _ _ _ _ (normr \o i) [set y | y > n%:R]); last first. exact: open_gt. move=> x Hx; apply: continuous_comp; last exact: norm_continuous. have Li : linear i := proj2 (Propf _ Fi). - apply: (@linear_continuous K V W (pack_linear Li)) => /=. + apply: (@linear_continuous _ _ K V W (pack_linear Li)) => /=. exact/(proj1 (bounded_landau (pack_linear Li)))/(proj1 (Propf _ Fi)). set O_inf := \bigcap_i (O i). have O_infempty : O_inf = set0. diff --git a/theories/showcase/summability.v b/theories/showcase/summability.v index fe5764d8a0..2348957cdd 100644 --- a/theories/showcase/summability.v +++ b/theories/showcase/summability.v @@ -39,10 +39,10 @@ Qed. Definition partial_sum {I : choiceType} {R : zmodType} (x : I -> R) (A : {fset I}) : R := \sum_(i : A) x (val i). -Definition sum (I : choiceType) {K : numDomainType} {R : normedModType K} +Definition sum (I : choiceType) d {K : numDomainType} {R : normedModType d K} (x : I -> R) : R := lim (partial_sum x @ totally). -Definition summable (I : choiceType) {K : realType} {R : normedModType K} +Definition summable (I : choiceType) d {K : realType} {R : normedModType d K} (x : I -> R) := \forall M \near +oo%R, \forall J \near totally, (partial_sum (fun i => `|x i|) J <= M)%R. diff --git a/theories/topology_theory/bool_topology.v b/theories/topology_theory/bool_topology.v index 2b9a52bd5f..67ebbe068e 100644 --- a/theories/topology_theory/bool_topology.v +++ b/theories/topology_theory/bool_topology.v @@ -17,9 +17,10 @@ Import Order.TTheory GRing.Theory Num.Theory. Local Open Scope classical_set_scope. Local Open Scope ring_scope. -HB.instance Definition _ := hasNbhs.Build bool principal_filter. -HB.instance Definition _ := Discrete_ofNbhs.Build bool erefl. -HB.instance Definition _ := DiscreteUniform_ofNbhs.Build bool. +HB.instance Definition _ := + hasNbhs.Build default_fdisp bool principal_filter. +HB.instance Definition _ := Discrete_ofNbhs.Build _ bool erefl. +HB.instance Definition _ := DiscreteUniform_ofNbhs.Build _ bool. Lemma bool_compact : compact [set: bool]. Proof. by rewrite setT_bool; apply/compactU; exact: compact_set1. Qed. @@ -38,7 +39,7 @@ move=> Ut; exists `]-oo, true[; first split => //. by move=> r /=; rewrite in_itv /=; case: r. Qed. -HB.instance Definition _ := Order_isNbhs.Build _ bool bool_nbhs_itv. +HB.instance Definition _ := Order_isNbhs.Build _ _ bool bool_nbhs_itv. HB.instance Definition _ {R : numDomainType} := - @DiscretePseudoMetric_ofUniform.Build R bool. + @DiscretePseudoMetric_ofUniform.Build _ R bool. diff --git a/theories/topology_theory/compact.v b/theories/topology_theory/compact.v index 65b3893de1..c5d47bbdc1 100644 --- a/theories/topology_theory/compact.v +++ b/theories/topology_theory/compact.v @@ -34,6 +34,10 @@ From mathcomp Require Import uniform_structure pseudometric_structure. Import Order.TTheory GRing.Theory Num.Theory. +Reserved Notation "d .-cluster" (at level 5, format "d .-cluster"). +Reserved Notation "d .-compact" (at level 5, format "d .-compact"). +Reserved Notation "d .-precompact" (at level 5, format "d .-precompact"). + Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. @@ -48,7 +52,7 @@ Class infer (P : Prop) := Infer : P. Lemma inferP (P : Prop) : P -> infer P. Proof. by []. Qed. Section Compact. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Definition cluster (F : set_system T) := [set p : T | F `#` nbhs p]. @@ -141,7 +145,7 @@ Qed. End Compact. Section near_covering. -Context {X : topologicalType}. +Context {d} {X : topologicalType d}. Definition near_covering (K : set X) := forall (I : Type) (F : set_system I) (P : I -> X -> Prop), @@ -212,7 +216,7 @@ Unshelve. all: by end_near. Qed. End near_covering. -Lemma ultra_cvg_clusterE (T : topologicalType) (F : set_system T) : +Lemma ultra_cvg_clusterE d (T : topologicalType d) (F : set_system T) : UltraFilter F -> cluster F = [set p | F --> p]. Proof. move=> FU; rewrite predeqE => p; split. @@ -220,7 +224,7 @@ move=> FU; rewrite predeqE => p; split. by move=> cvFp; rewrite cluster_cvgE; exists F; [apply: ultra_proper|split]. Qed. -Lemma compact_ultra (T : topologicalType) : +Lemma compact_ultra d (T : topologicalType d) : compact = [set A | forall F : set_system T, UltraFilter F -> F A -> A `&` [set p | F --> p] !=set0]. Proof. @@ -233,9 +237,9 @@ by move=> /(cvg_cluster sFG); exists p. Qed. Section Precompact. -Context {X : topologicalType}. +Context {d} {X : topologicalType d}. -Lemma compactU : setU_closed (@compact X). +Lemma compactU : setU_closed (@compact d X). Proof. move=> A B; rewrite compact_ultra => cptA cptB F UF FAB; rewrite setIUl. have [/cptA[x AFx]|] := in_ultra_setVsetC A UF; first by exists x; left. @@ -278,7 +282,8 @@ move=> clA; rewrite propeqE; split=> [[B AsubB [ + _ ]]|]. by rewrite {1}(_ : A = closure A) ?precompactE// -closure_id. Qed. -Definition locally_compact (A : set X) := [locally precompact A]. +Definition locally_compact (A : set X) := + [locally precompact A]. End Precompact. @@ -287,7 +292,7 @@ Definition finite_subset_cover (I : choiceType) (D : set I) exists2 D' : {fset I}, {subset D' <= D} & A `<=` cover [set` D'] F. Section Covers. -Variable T : topologicalType. +Context d (T : topologicalType d). Definition cover_compact (A : set T) := forall (I : choiceType) (D : set I) (f : I -> set T), @@ -323,7 +328,7 @@ Definition closed_fam_of (A : set T) I (D : set I) (f : I -> set T) := End Covers. Section PCovers. -Context {T : ptopologicalType}. +Context {d} {T : ptopologicalType d}. Lemma compact_In0 : compact = [set A | forall (I : choiceType) (D : set I) (f : I -> set T), @@ -346,7 +351,7 @@ exists p; split=> [|B C FB p_C]; first by have /AclFIp [] := FA. by have /AclFIp [_] := FB; move=> /(_ _ p_C). Qed. -Lemma compact_cover : compact = @cover_compact T. +Lemma compact_cover : compact = @cover_compact d T. Proof. rewrite compact_In0 cover_compactE predeqE => A. split=> [Aco I D f [g gop feAg] fcov|Aco I D f [g gcl feAg]]. @@ -393,7 +398,7 @@ Qed. End PCovers. -Lemma finite_compact {X : topologicalType} (A : set X) : +Lemma finite_compact {d} {X : topologicalType d} (A : set X) : finite_set A -> compact A. Proof. case/finite_setP=> n; elim: n A => [A|n ih A /eq_cardSP[x Ax /ih ?]]. @@ -401,8 +406,8 @@ case/finite_setP=> n; elim: n A => [A|n ih A /eq_cardSP[x Ax /ih ?]]. by rewrite -(setD1K Ax); apply: compactU => //; exact: compact_set1. Qed. -Lemma clopen_countable {T : ptopologicalType}: - compact [set: T] -> @second_countable T -> countable (@clopen T). +Lemma clopen_countable {d} {T : ptopologicalType d}: + compact [set: T] -> @second_countable d T -> countable (@clopen d T). Proof. move=> cmpT [B /fset_subset_countable cntB] [obase Bbase]. apply/(card_le_trans _ cntB)/pcard_surjP. @@ -430,7 +435,8 @@ move=> /DsubC /= [y /= yfs hyz]; exists (h' y) => //. by rewrite set_imfset /=; exists y. Qed. -Lemma compact_cauchy_cvg {T : puniformType} (U : set T) (F : set_system T) : +Lemma compact_cauchy_cvg {d} {T : puniformType d} + (U : set T) (F : set_system T) : ProperFilter F -> cauchy F -> F U -> compact U -> cvg F. Proof. move=> PF cf FU /(_ F PF FU) [x [_ clFx]]; apply: (cvgP x). @@ -442,8 +448,8 @@ move=> /(clFx _ (xsection (split_ent E) x) FD1)[z [Dz /xsectionP Exz]]. by near=> t; apply/(entourage_split z entE Exz)/D1D2E; split => //; near: t. Unshelve. all: by end_near. Qed. -Lemma compact_second_countable {R : realType} {T : pseudoPMetricType R} : - compact [set: T] -> @second_countable T. +Lemma compact_second_countable {d} {R : realType} {T : pseudoPMetricType d R} : + compact [set: T] -> @second_countable d T. Proof. have npos n : (0:R) < n.+1%:R^-1 by []. pose f n (z : T): set T := (ball z (PosNum (npos n))%:num)°. @@ -463,16 +469,30 @@ pose B := \bigcup_n (f n) @` [set` h'' n]; exists B;[|split]. by have [_ /(_ x) [// | w ? ?]] := projT2 (h' N); exists w. exists (f N w); first split => //; first (by exists N). apply: (subset_trans _ ballsubV) => z bz. - rewrite [_%:num]splitr; apply: (@ball_triangle _ _ w). + rewrite [_%:num]splitr; apply: (@ball_triangle _ _ _ w). by apply: (le_ball (ltW deleps)); apply/ball_sym; apply: interior_subset. by apply: (le_ball (ltW deleps)); apply: interior_subset. Qed. -Lemma clopen_surj {R : realType} {T : pseudoPMetricType R} : - compact [set: T] -> $|{surjfun [set: nat] >-> @clopen T}|. +Lemma clopen_surj {d} {R : realType} {T : pseudoPMetricType d R} : + compact [set: T] -> $|{surjfun [set: nat] >-> @clopen d T}|. Proof. move=> cmptT. -suff : @clopen T = set0 \/ $|{surjfun [set: nat] >-> @clopen T}|. +suff : @clopen _ T = set0 \/ $|{surjfun [set: nat] >-> @clopen _ T}|. by case => //; rewrite eqEsubset => -[/(_ _ clopenT)]. exact/pfcard_geP/clopen_countable/compact_second_countable. Qed. + +Module ExplicitNbhsDisplays. +Export pseudometric_structure.ExplicitNbhsDisplays. + +Notation "d .-cluster" := (@cluster d _). +Notation "'cluster'" := (@cluster default_fdisp _) (only printing). + +Notation "d .-compact" := (@compact d _). +Notation "'compact'" := (@compact default_fdisp _) (only printing). + +Notation "d .-precompact" := (@precompact d _). +Notation "'precompact'" := (@precompact default_fdisp _) (only printing). + +End ExplicitNbhsDisplays. \ No newline at end of file diff --git a/theories/topology_theory/connected.v b/theories/topology_theory/connected.v index 1d468a2e1a..1b680eec2e 100644 --- a/theories/topology_theory/connected.v +++ b/theories/topology_theory/connected.v @@ -15,6 +15,11 @@ From mathcomp Require Import topology_structure. (* ``` *) (******************************************************************************) +Reserved Notation "d .-connected" (at level 5, format "d .-connected"). +Reserved Notation "d .-separated" (at level 5, format "d .-separated"). +Reserved Notation "d .-connected_component" + (at level 5, format "d .-connected_component"). + Unset SsrOldRewriteGoalsOrder. (* remove the line when requiring MathComp >= 2.6 *) Set Implicit Arguments. Unset Strict Implicit. @@ -24,7 +29,7 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section connected_sets. -Variable T : topologicalType. +Context d (T : topologicalType d). Implicit Types A B C D : set T. Definition connected A := @@ -54,12 +59,13 @@ rewrite -propeqE; apply: notLR; rewrite propeqE. split=> [conE [E [E0 EU [E1 E2]]]|conE B B0 [C oC BAC] [D cD BAD]]. suff : E true = A. move/esym/(congr1 (setD^~ (closure (E true)))); rewrite EU setDUl. - have := @subset_closure _ (E true); rewrite -setD_eq0 => ->; rewrite setU0. + have := @subset_closure _ _ (E true) + ; rewrite -setD_eq0 => ->; rewrite setU0. by move/setDidPl : E2 => ->; exact/eqP/set0P. apply: (conE _ (E0 true)). - exists (~` (closure (E false))); first exact/closed_openC/closed_closure. rewrite EU setIUl. - have /subsets_disjoint -> := @subset_closure _ (E false); rewrite set0U. + have /subsets_disjoint -> := @subset_closure _ _ (E false); rewrite set0U. by apply/esym/setIidPl/disjoints_subset; rewrite setIC. - exists (closure (E true)); first exact: closed_closure. by rewrite EU setIUl E2 set0U; exact/esym/setIidPl/subset_closure. @@ -123,7 +129,7 @@ wlog E0c : E E0 EU sE / E false c. by apply: (G (E \o negb)) => //; [case => /=|rewrite EU setUC|rewrite separatedC]. move: (E0 true) => /set0P/eqP; apply. -have [/eqP //|/set0P[d E1d]] := boolP (E true == set0). +have [/eqP //|/set0P[d' E1d]] := boolP (E true == set0). have : \bigcup_(i in P) A i `<=` E false. suff AE : forall i, P i -> A i `<=` E false by move=> x [j ? ?]; exact: (AE j). move=> j Pj. @@ -132,7 +138,7 @@ have : \bigcup_(i in P) A i `<=` E false. exfalso; have E1c := AjE1 _ (AIc _ Pj). by move/separated_disjoint : sE; apply/eqP/set0P; exists c. rewrite EU subUset => -[_] /(_ _ E1d) E0d; exfalso. -by move/separated_disjoint : sE; apply/eqP/set0P; exists d. +by move/separated_disjoint : sE; apply/eqP/set0P; exists d'. Qed. Lemma connectedU A B : A `&` B !=set0 -> connected A -> connected B -> @@ -152,9 +158,10 @@ suff : A `<=` U. rewrite -setIidPl; apply: ctdA. - move: U0; rewrite C1E => -[z [clAx C1z]]; have [] := clAx C1. exact: open_nbhs_nbhs. - by move=> w [Aw C1w]; exists w; rewrite setIA (setIidl (@subset_closure _ _)). -- by exists C1 => //; rewrite C1E setIA (setIidl (@subset_closure _ _)). -- by exists C2 => //; rewrite C2E setIA (setIidl (@subset_closure _ _)). + by move=> w [Aw C1w]; exists w + ; rewrite setIA (setIidl (@subset_closure _ _ _)). +- by exists C1 => //; rewrite C1E setIA (setIidl (@subset_closure _ _ _)). +- by exists C2 => //; rewrite C2E setIA (setIidl (@subset_closure _ _ _)). Qed. Definition connected_component (A : set T) (x : T) := @@ -234,5 +241,21 @@ Qed. End connected_sets. -Arguments connected {T}. -Arguments connected_component {T}. +Arguments connected {d T}. +Arguments connected_component {d T}. + +Module ExplicitNbhsDisplays. +Export topology_structure.ExplicitNbhsDisplays. + +Notation "d .-connected" := (@connected d _) (format "d .-connected"). +Notation "'connected'" := (@connected default_fdisp _) (only printing). + +Notation "d .-separated" := (@separated d _) (format "d .-separated"). +Notation "'separated'" := (@separated default_fdisp _) (only printing). + +Notation "d .-connected_component" := (@connected_component d _) + (format "d .-connected_component"). +Notation "'connected_component'" := + (@connected_component default_fdisp _) (only printing). + +End ExplicitNbhsDisplays. \ No newline at end of file diff --git a/theories/topology_theory/discrete_topology.v b/theories/topology_theory/discrete_topology.v index 1b3cb281cf..526467bf86 100644 --- a/theories/topology_theory/discrete_topology.v +++ b/theories/topology_theory/discrete_topology.v @@ -33,55 +33,61 @@ Import Order.TTheory GRing.Theory Num.Def Num.Theory. Local Open Scope classical_set_scope. Local Open Scope ring_scope. -HB.mixin Record Discrete_ofNbhs T & Nbhs T := { - nbhs_principalE : (@nbhs T _) = principal_filter; +HB.mixin Record Discrete_ofNbhs d T & Nbhs d T := { + nbhs_principalE : (@nbhs _ T _) = principal_filter; }. #[short(type="discreteNbhsType")] -HB.structure Definition DiscreteNbhs := {T of Nbhs T & Discrete_ofNbhs T}. +HB.structure Definition DiscreteNbhs d := {T of Nbhs d T & Discrete_ofNbhs d T}. + +HB.instance Definition _ d d' (T : discreteNbhsType d) := + Discrete_ofNbhs.Build d' (with_fdisp d' T) nbhs_principalE. Definition discrete_ent {T} : set_system (T * T) := globally (range (fun x => (x, x))). (** Note: having the discrete topology does not guarantee the discrete uniformity. Likewise for the discrete metric. Consider [set 1/n | n in R] *) -HB.mixin Record Discrete_ofUniform T & Uniform T := { - uniform_discrete : @entourage T = discrete_ent +HB.mixin Record Discrete_ofUniform d T & Uniform d T := { + uniform_discrete : @entourage _ T = discrete_ent }. Definition discrete_ball {R : numDomainType} {T} (x : T) (eps : R) y : Prop := x = y. -HB.mixin Record Discrete_ofPseudometric {R : numDomainType} T & - PseudoMetric R T := { - metric_discrete : @ball R T = @discrete_ball R T +HB.mixin Record Discrete_ofPseudometric d {R : numDomainType} T & + PseudoMetric d R T := { + metric_discrete : @ball _ R T = @discrete_ball R T }. #[short(type="discreteTopologicalType")] -HB.structure Definition DiscreteTopology := - { T of DiscreteNbhs T & Topological T}. +HB.structure Definition DiscreteTopology d := + { T of DiscreteNbhs d T & Topological d T}. #[short(type="discreteOrderTopologicalType")] -HB.structure Definition DiscreteOrderTopology d := - { T of Discrete_ofNbhs T & OrderTopological d T}. +HB.structure Definition DiscreteOrderTopology td od := + { T of Discrete_ofNbhs td T & OrderTopological td od T}. #[short(type="pdiscreteTopologicalType")] -HB.structure Definition PointedDiscreteTopology := - { T of DiscreteTopology T & Pointed T}. +HB.structure Definition PointedDiscreteTopology d := + { T of DiscreteTopology d T & Pointed T}. #[short(type="pdiscreteOrderTopologicalType")] -HB.structure Definition PointedDiscreteOrderTopology d := - { T of Discrete_ofNbhs T & OrderTopological d T & Pointed T}. +HB.structure Definition PointedDiscreteOrderTopology td od := + { T of Discrete_ofNbhs td T & OrderTopological td od T & Pointed T}. #[short(type="discreteUniformType")] -HB.structure Definition DiscreteUniform := - { T of Discrete_ofUniform T & Uniform T & Discrete_ofNbhs T}. +HB.structure Definition DiscreteUniform d := + { T of Discrete_ofUniform d T & Uniform d T & Discrete_ofNbhs d T}. #[short(type="discretePseudoMetricType")] -HB.structure Definition DiscretePseudoMetric {R : numDomainType} := - { T of Discrete_ofPseudometric R T & PseudoMetric R T & DiscreteUniform T}. +HB.structure Definition DiscretePseudoMetric {R : numDomainType} d := + { T of Discrete_ofPseudometric d R T & PseudoMetric d R T + & DiscreteUniform d T }. + +HB.saturate with_fdisp. -HB.builders Context T & Discrete_ofNbhs T. +HB.builders Context d T & Discrete_ofNbhs d T. Local Lemma principal_nbhs_filter (p : T) : ProperFilter (nbhs p). Proof. rewrite nbhs_principalE; exact: principal_filter_proper. Qed. @@ -93,37 +99,38 @@ Local Lemma principal_nbhs_nbhs (p : T) (A : set T) : nbhs p A -> nbhs p (nbhs^~ A). Proof. by move=> ?; rewrite {1}nbhs_principalE; apply/principal_filterP. Qed. -HB.instance Definition _ := @Nbhs_isNbhsTopological.Build T +HB.instance Definition _ := @Nbhs_isNbhsTopological.Build d T principal_nbhs_filter principal_nbhs_singleton principal_nbhs_nbhs. HB.end. -HB.factory Record DiscreteUniform_ofNbhs T & Discrete_ofNbhs T & Nbhs T := {}. -HB.builders Context T & DiscreteUniform_ofNbhs T. +HB.factory Record DiscreteUniform_ofNbhs d T + & Discrete_ofNbhs d T & Nbhs d T := {}. +HB.builders Context d T & DiscreteUniform_ofNbhs d T. Local Open Scope relation_scope. -Local Notation d := (@discrete_ent T). +Local Notation dE := (@discrete_ent T). -Local Lemma discrete_entourage_filter : Filter d. +Local Lemma discrete_entourage_filter : Filter dE. Proof. exact: globally_filter. Qed. -Local Lemma discrete_entourage_diagonal : forall A, d A -> diagonal `<=` A. +Local Lemma discrete_entourage_diagonal : forall A, dE A -> diagonal `<=` A. Proof. by move=> ? + x x12; apply; exists x.1; rewrite // {2}x12 -surjective_pairing. Qed. -Local Lemma discrete_entourage_inv : forall A, d A -> d A^-1. +Local Lemma discrete_entourage_inv : forall A, dE A -> dE A^-1. Proof. by move=> ? dA x [i _ <-]; apply: dA; exists i. Qed. Local Lemma discrete_entourage_split_ex : - forall A, d A -> exists2 B, d B & B \; B `<=` A. + forall A, dE A -> exists2 B, dE B & B \; B `<=` A. Proof. move=> ? dA; exists (range (fun x => (x, x))) => //. by rewrite set_compose_diag => x [i _ <-]; apply: dA; exists i. Qed. -Local Lemma discrete_entourage_nbhsE : (@nbhs T _) = nbhs_ d. +Local Lemma discrete_entourage_nbhsE : (@nbhs _ T _) = nbhs_ dE. Proof. rewrite funeqE => x; rewrite nbhs_principalE eqEsubset; split => U. move/principal_filterP => ?; exists diagonal; first by move=> ? [w _ <-]. @@ -132,7 +139,7 @@ case => w entW wU; apply/principal_filterP; apply: wU; apply/mem_set. exact: entW. Qed. -HB.instance Definition _ := @Nbhs_isUniform.Build T +HB.instance Definition _ := @Nbhs_isUniform.Build d T discrete_ent discrete_entourage_filter discrete_entourage_diagonal @@ -140,14 +147,14 @@ HB.instance Definition _ := @Nbhs_isUniform.Build T discrete_entourage_split_ex discrete_entourage_nbhsE. -HB.instance Definition _ := @Discrete_ofUniform.Build T erefl. +HB.instance Definition _ := @Discrete_ofUniform.Build d T erefl. HB.end. -HB.factory Record DiscretePseudoMetric_ofUniform (R : numDomainType) T & - DiscreteUniform T := {}. +HB.factory Record DiscretePseudoMetric_ofUniform d (R : numDomainType) T & + DiscreteUniform d T := {}. -HB.builders Context R T & DiscretePseudoMetric_ofUniform R T. +HB.builders Context d R T & DiscretePseudoMetric_ofUniform d R T. Local Lemma discrete_ball_center x (eps : R) : 0 < eps -> @discrete_ball R T x eps x. @@ -169,36 +176,38 @@ by rewrite {2}z12 -surjective_pairing. Qed. HB.instance Definition _ := - @Uniform_isPseudoMetric.Build R T (@discrete_ball R T) + @Uniform_isPseudoMetric.Build d R T (@discrete_ball R T) discrete_ball_center discrete_ball_sym discrete_ball_triangle discrete_entourageE. -Local Lemma discrete_ballE : @ball R T = @discrete_ball R T. +Local Lemma discrete_ballE : @ball _ R T = @discrete_ball R T. Proof. by rewrite funeq2E => ? ?. Qed. -HB.instance Definition _ := @Discrete_ofPseudometric.Build R T discrete_ballE. +HB.instance Definition _ := @Discrete_ofPseudometric.Build d R T discrete_ballE. HB.end. Definition discrete_topology (T : Type) : Type := T. +Fact discrete_fdisp : fdisp_t. +Proof. by []. Qed. HB.instance Definition _ (T : choiceType) := Choice.copy (discrete_topology T) T. HB.instance Definition _ (T : pointedType) := Pointed.on (discrete_topology T). HB.instance Definition _ (T : choiceType) := - hasNbhs.Build (discrete_topology T) principal_filter. + hasNbhs.Build discrete_fdisp (discrete_topology T) principal_filter. HB.instance Definition _ (T : choiceType) := - Discrete_ofNbhs.Build (discrete_topology T) erefl. + Discrete_ofNbhs.Build _ (discrete_topology T) erefl. HB.saturate discrete_topology. HB.instance Definition _ (T : choiceType) := - DiscreteUniform_ofNbhs.Build (discrete_topology T). + DiscreteUniform_ofNbhs.Build _ (discrete_topology T). HB.instance Definition _ {R : numDomainType} (T : choiceType) := - @DiscretePseudoMetric_ofUniform.Build R (discrete_topology T). + @DiscretePseudoMetric_ofUniform.Build _ R (discrete_topology T). Section discrete_topology. -Context {X : discreteTopologicalType}. +Context {d} {X : discreteTopologicalType d}. Lemma discrete_open (A : set X) : open A. Proof. diff --git a/theories/topology_theory/edist.v b/theories/topology_theory/edist.v index a78c6e61a2..5dec9b32ae 100644 --- a/theories/topology_theory/edist.v +++ b/theories/topology_theory/edist.v @@ -31,7 +31,7 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section pseudoMetricDist. -Context {R : realType} {X : pseudoMetricType R}. +Context {d} {R : realType} {X : pseudoMetricType d R}. Implicit Types r : R. Definition edist (xy : X * X) : \bar R := @@ -143,9 +143,9 @@ move=> [x y]; have [pE U /= Upinf|] := eqVneq (edist (x, y)) +oo%E. rewrite -ltey -ge0_fin_numE// => efin. rewrite /continuous_at -[edist (x, y)]fineK//; apply: cvg_EFin. by have := edist_fin_open efin; apply: filter_app; near=> w. -apply/(@metricType_numDomainType.cvgrPdist_le _ R^o) => _/posnumP[eps]/=. +apply/(@metricType_numDomainType.cvgrPdist_le _ _ R^o) => _/posnumP[eps]/=. suff: \forall t \near (nbhs x, nbhs y), - @mdist _ R^o (fine (edist (x, y))) (fine (edist t)) <= eps%:num. + @mdist _ _ R^o (fine (edist (x, y))) (fine (edist t)) <= eps%:num. by []. rewrite -near2_pair; near=> a b => /=. have abxy : (edist (a, b) <= edist (x, a) + edist (x, y) + edist (y, b))%E. @@ -206,7 +206,7 @@ Hint Extern 0 (is_true (0%R <= edist _)%E) => solve [apply: edist_ge0] : core. Hint Extern 0 (is_true (edist _ != -oo%E)) => solve [apply: edist_neqNy] : core. Section edist_inf. -Context {R : realType} {T : pseudoMetricType R} (A : set T). +Context {d} {R : realType} {T : pseudoMetricType d R} (A : set T). Definition edist_inf z := ereal_inf [set edist (z, a) | a in A]. @@ -230,7 +230,7 @@ apply/lee_addgt0Pr => _/posnumP[eps]. have [//|? [a Aa <-] yaeps] := @lb_ereal_inf_adherent R _ eps%:num _ fyn. apply: le_trans. by apply: (@ereal_inf_lbound _ _ (edist (x, a))); exists a. -apply: le_trans; first exact: (@edist_triangle _ _ _ y). +apply: le_trans; first exact: (@edist_triangle _ _ _ _ y). by rewrite -addeA leeD2lE // ltW. Qed. @@ -248,7 +248,7 @@ have [] := eqVneq (edist_inf z) +oo%E. apply/ereal_inf_pinfty => r [a Aa] war; apply/zAp; exists a => //. have /gee0P[|[r' r'pos war']] := edist_ge0 (w, a). by rewrite war => ->; apply: zAp; exists a. - have := @edist_triangle _ _ z w a; rewrite war'; apply: contra_leP => _. + have := @edist_triangle _ _ _ z w a; rewrite war'; apply: contra_leP => _. rewrite (@le_lt_trans _ _ (1 + r'%:E)%E) ?leeD2r ?edist_fin//. by rewrite -EFinD [edist (z, a)]zAp ?ltey //; exists a. rewrite -ltey -ge0_fin_numE ?edist_inf_ge0 // => fz_fin. @@ -260,12 +260,13 @@ have fwfin : \forall w \near z, edist_inf w \is a fin_num. rewrite -ge0_fin_numE ?adde_ge0 ?edist_inf_ge0 //. rewrite fin_numD fz_fin andbT; apply/edist_finP; exists 1 => //. exact/ball_sym. -split => //; apply/(@metricType_numDomainType.cvgrPdist_le _ R^o) => _/posnumP[eps]. +split => //. +apply/(@metricType_numDomainType.cvgrPdist_le _ _ R^o) => _/posnumP[eps]. have : nbhs z (ball z eps%:num) by exact: nbhsx_ballx. apply: filter_app; near_simpl; move: fwfin; apply: filter_app. near=> t => tfin /= /[dup] ?. have ztfin : edist (z, t) \is a fin_num by apply/edist_finP; exists eps%:num. -move=> /(@edist_fin _ _ _ (z, t)) - /(_ trivial). +move=> /(@edist_fin _ _ _ _ (z, t)) - /(_ trivial). rewrite -[edist (z, t)]fineK ?lee_fin //; apply: le_trans. rewrite ler_norml; apply/andP; split. rewrite lerBrDr addrC lerBlDr addrC -fineD //. diff --git a/theories/topology_theory/function_spaces.v b/theories/topology_theory/function_spaces.v index 402bcaa177..3929e2bc55 100644 --- a/theories/topology_theory/function_spaces.v +++ b/theories/topology_theory/function_spaces.v @@ -121,51 +121,84 @@ Import Order.TTheory GRing.Theory Num.Theory. Local Open Scope classical_set_scope. Local Open Scope ring_scope. +Fact ptws_fdisp : fdisp_t. +Proof. by []. Qed. + +Notation "'ptws'" := (ptws_fdisp) (only printing) : fdisp_scope. + (** Product topology, also known as the topology of pointwise convergence *) Section Product_Topology. Definition prod_topology {I : Type} (T : I -> Type) := forall i, T i. -Variable I : Type. +Definition product_topology_def I d (T : forall i : I, topologicalType (d i)) := + with_fdisp ptws_fdisp (sup_topology (fun i => + Topological.class (initial_topology (fun f : (forall i, T i) => f i)) + )). -Definition product_topology_def (T : I -> topologicalType) := - sup_topology (fun i => Topological.class - (initial_topology (fun f : (forall i, T i) => f i))). - -HB.instance Definition _ (T : I -> topologicalType) := +HB.instance Definition _ I d (T : forall i : I, topologicalType (d i)) := Topological.copy (prod_topology T) (product_topology_def T). -HB.instance Definition _ (T : I -> uniformType) := - Uniform.copy (prod_topology T) - (sup_topology (fun i => Uniform.class (initial_topology (@proj _ T i)))). +Definition product_uniform_def I d (T : forall i : I, uniformType (d i)) := + with_fdisp ptws_fdisp (sup_topology (fun i => + Uniform.class (initial_topology (fun f : (forall i, T i) => f i)) + )). + +HB.instance Definition _ I d (T : forall i : I, uniformType (d i)) := + Uniform.copy (prod_topology T) (product_uniform_def T). + +Definition product_pseudometric_def + (Ii : countType) (d : Ii -> fdisp_t) (R : realType) + (Tc : forall i : Ii, pseudoMetricType (d i) R) := + with_fdisp ptws_fdisp (sup_pseudometric + (fun i => PseudoMetric.class (initial_topology (@proj _ Tc i))) + (countableP _)). -HB.instance Definition _ (R : realType) (Ii : countType) - (Tc : Ii -> pseudoMetricType R) := PseudoMetric.copy (prod_topology Tc) - (sup_pseudometric (fun i => PseudoMetric.class (initial_topology (@proj _ Tc i))) - (countableP _)). +HB.instance Definition _ (R : realType) (Ii : countType) + (d : Ii -> fdisp_t) (Tc : forall i, pseudoMetricType (d i) R) := + PseudoMetric.copy (prod_topology Tc) (product_pseudometric_def Tc). End Product_Topology. Notation "{ 'ptws' U -> V }" := (prod_topology (fun _ : U => V)) : type_scope. Notation "{ 'ptws' , F --> f }" := - (cvg_to F (nbhs (f : {ptws _ -> _}))) : classical_set_scope. + (cvg_to (nbhs F) (nbhs (f :> {ptws _ -> _}))) + (only parsing): classical_set_scope. +Notation "{ 'ptws' , F --> f }" := + (cvg_to (nbhs F) (@nbhs ptws_fdisp _ _ f)) + (only printing) : classical_set_scope. +Notation pointwise_continuous f := + (continuous (f :> {ptws _ -> _})) + (only parsing). +Notation "'pointwise_continuous' f" := + (forall x, @continuous_at ptws_fdisp _ _ _ x f) + (only printing, at level 2). Module ArrowAsProduct. -HB.instance Definition _ (U : Type) (T : U -> topologicalType) := - Topological.copy (forall x : U, T x) (prod_topology T). - -HB.instance Definition _ (U : Type) (T : U -> uniformType) := - Uniform.copy (forall x : U, T x) (prod_topology T). - -HB.instance Definition _ (U T : topologicalType) := +HB.instance Definition _ (U : Type) (d : U -> fdisp_t) + (T : forall u, topologicalType (d u)) := + Topological.copy + (forall x : U, T x) + (prod_topology T). + +HB.instance Definition _ (U : Type) (d : U -> fdisp_t) + (T : forall u, uniformType (d u)) := + Uniform.copy + (forall x : U, T x) + (prod_topology T). + +HB.instance Definition _ d d' + (U : topologicalType d) (T : topologicalType d') := Topological.copy (continuousType U T) - (initial_topology (id : continuousType U T -> (U -> T))). + (with_fdisp default_fdisp + (initial_topology (id : continuousType U T -> (U -> T)))). -HB.instance Definition _ (U : topologicalType) (T : uniformType) := +HB.instance Definition _ d d' (U : topologicalType d) (T : uniformType d') := Uniform.copy (continuousType U T) - (initial_topology (id : continuousType U T -> (U -> T))). + (with_fdisp default_fdisp + (initial_topology (id : continuousType U T -> (U -> T)))). End ArrowAsProduct. @@ -173,9 +206,10 @@ Section product_spaces. Local Import ArrowAsProduct. Section projection_maps. -Context {I : eqType} {K : I -> topologicalType}. +Context {I : eqType} {d : I -> fdisp_t}. +Context {K : forall i, topologicalType (d i)}. -Lemma proj_continuous i : continuous (@proj I K i). +Lemma proj_continuous i : pointwise_continuous (@proj I K i). Proof. move=> f; have /cvg_sup/(_ i)/cvg_image : f --> f by apply: cvg_id. move=> h; apply: cvg_trans (h _) => {h}. @@ -223,8 +257,8 @@ Qed. End projection_maps. -Lemma tychonoff (I : eqType) (T : I -> topologicalType) - (A : forall i, set (T i)) : +Lemma tychonoff (I : eqType) (d : I -> fdisp_t) + (T : forall i, topologicalType (d i)) (A : forall i, set (T i)) : (forall i, compact (A i)) -> compact [set f : forall i, T i | forall i, A i (f i)]. Proof. @@ -259,16 +293,18 @@ apply/cvg_sup => i; apply/cvg_image=> //. by have /(xgetPex (a0 i)) [] := cvpFA i. Qed. -Lemma perfect_prod {I : Type} (i : I) (K : I -> topologicalType) : +Lemma perfect_prod {I : Type} (d : I -> fdisp_t) (i : I) + (K : forall i, topologicalType (d i)) : perfect_set [set: K i] -> perfect_set [set: forall i, K i]. Proof. move=> /perfectTP KPo; apply/perfectTP => f oF; apply: (KPo (f i)). rewrite (_ : [set f i] = proj i @` [set f]). by rewrite eqEsubset; split => ? //; [move=> -> /=; exists f | case=> g ->]. -by apply: (@proj_open {classic I} _ i); exact: oF. +by apply: (@proj_open {classic I} _ _ i); exact: oF. Qed. -Lemma perfect_diagonal (K : nat -> topologicalType) : +Lemma perfect_diagonal (d : nat -> fdisp_t) + (K : forall n, topologicalType (d n)) : (forall i, exists xy : K i * K i, xy.1 != xy.2) -> perfect_set [set: forall i, K i]. Proof. @@ -288,7 +324,8 @@ rewrite /g ltnn /derange eq_sym; have [->|//] := eqVneq (f N) (distincts N).1. exact: projT2 (sigW (npts N)). Qed. -Lemma zero_dimension_prod (I : choiceType) (T : I -> topologicalType) : +Lemma zero_dimension_prod (I : choiceType) (d : I -> fdisp_t) + (T : forall i, topologicalType (d i)) : (forall i, zero_dimensional (T i)) -> zero_dimensional (forall i, T i). Proof. @@ -299,10 +336,10 @@ exists (proj i @^-1` U); split => //; apply: preimage_clopen => //. exact/proj_continuous. Qed. -Lemma totally_disconnected_prod (I : choiceType) - (T : I -> topologicalType) (A : forall i, set (T i)) : +Lemma totally_disconnected_prod (I : choiceType) (d : I -> fdisp_t) + (T : forall i, topologicalType (d i)) (A : forall i, set (T i)) : (forall i, totally_disconnected (A i)) -> - @totally_disconnected (forall i, T i) (fun f => forall i, A i (f i)). + @totally_disconnected _ (forall i, T i) (fun f => forall i, A i (f i)). Proof. move=> dsctAi x /= Aix; rewrite eqEsubset; split; last first. by move=> ? ->; exact: connected_component_refl. @@ -323,19 +360,22 @@ Qed. are equivalent (the last equivalence seems to require `accessible_space`). *) Section product_embeddings. -Context {I : choiceType} {T : topologicalType} {U_ : I -> topologicalType}. +Context {I : choiceType} {d : fdisp_t} {d' : I -> fdisp_t}. +Context {T : topologicalType d} {U_ : forall i, topologicalType (d' i)}. Variable (f_ : forall i, T -> U_ i). +Import ExplicitNbhsDisplays. + Definition separate_points_from_closed := forall (U : set T) x, closed U -> ~ U x -> exists i, ~ (closure (f_ i @` U)) (f_ i x). Hypothesis sepf : separate_points_from_closed. Hypothesis ctsf : forall i, continuous (f_ i). -Let initialT : topologicalType := +Let initialT : topologicalType _ := sup_topology (fun i => Topological.on (initial_topology (f_ i))). -Let PU : topologicalType := prod_topology U_. +Let PU : topologicalType _ := prod_topology U_. Local Notation sup_open := (@open initialT). Local Notation "'weak_open' i" := (@open initialT) (at level 0). @@ -344,29 +384,29 @@ Local Notation natural_open := (@open T). Lemma initial_sep_cvg (F : set_system T) (x : T) : Filter F -> (F --> (x : T)) <-> (F --> (x : initialT)). Proof. -move=> FF; split. +move=> FF; split. move=> FTx; apply/cvg_sup => i U. - have /= -> := @nbhsE (initial_topology (f_ i)) x. + have /= -> := @nbhsE _ (initial_topology (f_ i)) x. case=> B [[C oC <- ?]] /filterS; apply; apply: FTx; rewrite /= nbhsE. by exists (f_ i @^-1` C) => //; split => //; exact: open_comp. move/cvg_sup => wiFx U; rewrite /= nbhs_simpl nbhsE => [[B [oB ?]]]. move/filterS; apply; have [//|i nclfix] := @sepf _ x (open_closedC oB). -apply: (wiFx i); have /= -> := @nbhsE (initial_topology (f_ i)) x. +apply: (wiFx i); have /= -> := @nbhsE _ (initial_topology (f_ i)) x. exists (f_ i @^-1` (~` closure [set f_ i x | x in ~` B])); [split=>//|]. apply: open_comp; last by rewrite ?openC//; exact: closed_closure. - by move=> + _; exact: (@initial_continuous _ _ (f_ i)). + by move=> + _; exact: (@initial_continuous _ _ _ (f_ i)). rewrite -interiorC interiorEbigcup preimage_bigcup => z [V [oV]] VnB => /VnB. by move/forall2NP => /(_ z) [] // /contrapT. Qed. -Lemma initial_sep_nbhsE x : @nbhs T T x = @nbhs T initialT x. +Lemma initial_sep_nbhsE x : @nbhs _ T T x = @nbhs _ T initialT x. Proof. rewrite predeqE => U; split; move: U. by have P := initial_sep_cvg x (nbhs_filter (x : initialT)); exact/P. by have P := initial_sep_cvg x (nbhs_filter (x : T)); exact/P. Qed. -Lemma initial_sep_openE : @open T = @open initialT. +Lemma initial_sep_openE : @open _ T = @open _ initialT. Proof. rewrite predeqE => A; rewrite ?openE /interior. by split => + z => /(_ z); rewrite initial_sep_nbhsE. @@ -379,7 +419,7 @@ Proof. suff : continuous (join_product : initialT -> PU). by move=> cts x U => /cts; rewrite nbhs_simpl /= -initial_sep_nbhsE. move=> x; apply/cvg_sup; first exact/fmap_filter/(nbhs_filter (x : initialT)). -move=> i; move: x; apply/(@continuousP _ (initial_topology (@^~ i))) => A [B ? E]. +move=> i; move: x; apply/(@continuousP _ _ _ (initial_topology (@^~ i))) => A [B ? E]. rewrite -E (_ : @^~ i = proj i) //. have -> : join_product @^-1` (proj i @^-1` B) = f_ i @^-1` B by []. apply: open_comp => // + _; rewrite /cvg_to => x U. @@ -389,7 +429,7 @@ Qed. Local Notation prod_open := (@open (subspace (range join_product))). Lemma join_product_open (A : set T) : open A -> - open ((join_product @` A) : set (subspace (range join_product))). + (range join_product).-sub.-open (join_product @` A). Proof. move=> oA; rewrite openE => y /= [x Ax] jxy. have [// | i nAfiy] := @sepf (~` A) x (open_closedC oA). @@ -416,7 +456,7 @@ by apply: subset_closure; exists y. Qed. Lemma join_product_initial : set_inj [set: T] join_product -> - @open T = @open (initial_topology join_product). + @open _ T = @open _ (initial_topology join_product). Proof. move=> inj; rewrite predeqE => U; split; first last. by move=> [V ? <-]; apply: open_comp => // + _; exact: join_product_continuous. @@ -429,8 +469,9 @@ Qed. End product_embeddings. -Global Instance prod_topology_filter (U : Type) (T : U -> ptopologicalType) - (f : prod_topology T) : ProperFilter (nbhs f). +Global Instance prod_topology_filter (U : Type) (d : U -> fdisp_t) + (T : forall u, ptopologicalType (d u)) (f : prod_topology T) : + ProperFilter (nbhs f). Proof. exact: nbhs_pfilter. Qed. End product_spaces. @@ -438,12 +479,20 @@ End product_spaces. (*HB.instance Definition _ (U : Type) (T : U -> ptopologicalType) := Pointed.copy (forall x : U, T x) (prod_topology T).*) +Definition arrow_uniform_type d (T : choiceType) (U : uniformType d) + := T -> U. + +Fact arrow_uniform_fdisp : fdisp_t. +Proof. by []. Qed. + +Notation uniform_arrow := (arrow_uniform_fdisp). + (**md the uniform topologies type *) Section fct_Uniform. Local Open Scope relation_scope. -Variables (T : choiceType) (U : uniformType). +Context d (T : choiceType) (U : uniformType d). -Definition fct_ent := filter_from (@entourage U) +Definition fct_ent := filter_from (@entourage _ U) (fun P => [set fg | forall t : T, P (fg.1 t, fg.2 t)]). Lemma fct_ent_filter : Filter fct_ent. @@ -475,18 +524,19 @@ move=> fg [h spBfh spBhg]. by apply: sBA => t; apply: entourage_split (spBfh t) (spBhg t). Qed. -Definition arrow_uniform_type : Type := T -> U. +Notation arrow_uniform_type := (arrow_uniform_type T U). #[export] HB.instance Definition _ := Choice.on arrow_uniform_type. -#[export] HB.instance Definition _ := isUniform.Build arrow_uniform_type +#[export] HB.instance Definition _ := + isUniform.Build arrow_uniform_fdisp arrow_uniform_type fct_ent_filter fct_ent_refl fct_ent_inv fct_ent_split. End fct_Uniform. -#[export] HB.instance Definition _ {T : choiceType} {U : puniformType} := +#[export] HB.instance Definition _ {d} {T : choiceType} {U : puniformType d} := Pointed.on (arrow_uniform_type T U). -Lemma cvg_fct_entourageP (T : choiceType) (U : uniformType) +Lemma cvg_fct_entourageP d (T : choiceType) (U : uniformType d) (F : set_system (arrow_uniform_type T U)) (FF : Filter F) (f : arrow_uniform_type T U) : F --> f <-> forall A, entourage A -> @@ -499,10 +549,10 @@ by near=> g do apply: sPA; apply: Ff. Unshelve. all: by end_near. Qed. Section fun_Complete. -Context {T : choiceType} {U : completeType}. +Context {d} {T : choiceType} {U : completeType d}. Lemma fun_complete (F : set_system (arrow_uniform_type T U)) - {FF : ProperFilter F} : cauchy F -> cvg F. + {FF : ProperFilter F} : cauchy F -> cvg F. Proof. move=> Fc. have /(_ _) /cauchy_cvg /cvg_app_entourageP cvF : cauchy (@^~_ @ F). @@ -516,7 +566,7 @@ by exists (split_ent A)^-1%relation => /=. Unshelve. all: by end_near. Qed. HB.instance Definition _ := Uniform_isComplete.Build - (arrow_uniform_type T U) fun_complete. + _ (arrow_uniform_type T U) fun_complete. (*HB.instance Definition _ (R : numFieldType) := Uniform_isComplete.Build (arrow_uniform_type T U) cauchy_cvg.*) @@ -528,7 +578,7 @@ End fun_Complete. (** Functional metric spaces *) Section fct_PseudoMetric. -Variable (T : choiceType) (R : numFieldType) (U : pseudoMetricType R). +Context d (T : choiceType) (R : numFieldType) (U : pseudoMetricType d R). Definition fct_ball (x : arrow_uniform_type T U) (eps : R) (y : arrow_uniform_type T U) := forall t : T, ball (x t) eps (y t). Lemma fct_ball_center (x : T -> U) (e : R) : 0 < e -> fct_ball x e x. @@ -538,7 +588,7 @@ Lemma fct_ball_sym (x y : T -> U) (e : R) : fct_ball x e y -> fct_ball y e x. Proof. by move=> P t; apply: ball_sym. Qed. Lemma fct_ball_triangle (x y z : T -> U) (e1 e2 : R) : fct_ball x e1 y -> fct_ball y e2 z -> fct_ball x (e1 + e2) z. -Proof. by move=> xy yz t; apply: (@ball_triangle _ _ (y t)). Qed. +Proof. by move=> xy yz t; apply: (@ball_triangle _ _ _ (y t)). Qed. Lemma fct_entourage : entourage = entourage_ fct_ball. Proof. rewrite predeqE => A; split; last first. @@ -547,23 +597,25 @@ move=> [P]; rewrite -entourage_ballE => -[_/posnumP[e] sbeP] sPA. by exists e%:num => //= fg fg_e; apply: sPA => t; apply: sbeP; apply: fg_e. Qed. -HB.instance Definition _ := Uniform_isPseudoMetric.Build R +HB.instance Definition _ := Uniform_isPseudoMetric.Build _ R (arrow_uniform_type T U) fct_ball_center fct_ball_sym fct_ball_triangle fct_entourage. End fct_PseudoMetric. Module ArrowAsUniformType. -HB.instance Definition _ (U : choiceType) (V : uniformType) := +HB.instance Definition _ d (U : choiceType) (V : uniformType d) := Uniform.copy (U -> V) (arrow_uniform_type U V). -HB.instance Definition _ (U : choiceType) (R : numFieldType) - (V : pseudoMetricType R) := - PseudoMetric.copy (U -> V) (arrow_uniform_type U V). +HB.instance Definition _ d (U : choiceType) (R : numFieldType) + (V : pseudoMetricType d R) := + PseudoMetric.copy (U -> V) + (arrow_uniform_type U V). -HB.instance Definition _ (U : topologicalType) (T : uniformType) := +HB.instance Definition _ d d' (U : topologicalType d) (T : uniformType d') := Uniform.copy (continuousType U T) - (initial_topology (id : continuousType U T -> (U -> T))). + (with_fdisp default_fdisp + (initial_topology (id : continuousType U T -> (U -> T)))). (*HB.instance Definition _ (U : topologicalType) (R : realType) (T : pseudoMetricType R) := @@ -578,7 +630,7 @@ Section Cvg_switch. Context {T1 T2 : choiceType}. Local Import ArrowAsUniformType. -Lemma cvg_switch_1 {U : uniformType} +Lemma cvg_switch_1 {d} {U : uniformType d} F1 {FF1 : ProperFilter F1} F2 {FF2 : Filter F2} (f : T1 -> T2 -> U) (g : T2 -> U) (h : T1 -> U) (l : U) : f @ F1 --> g -> (forall x1, f x1 @ F2 --> h x1) -> h @ F1 --> l -> @@ -593,7 +645,7 @@ move: (x2); near: x1; have /cvg_fct_entourageP /(_ _^-1%relation):= fg; apply. exact: entourage_inv. Unshelve. all: by end_near. Qed. -Lemma cvg_switch_2 {U : completeType} +Lemma cvg_switch_2 {d} {U : completeType d} F1 {FF1 : ProperFilter F1} F2 {FF2 : ProperFilter F2} (f : T1 -> T2 -> U) (g : T2 -> U) (h : T1 -> U) : f @ F1 --> g -> (forall x, f x @ F2 --> h x) -> @@ -612,7 +664,7 @@ apply: (entourage_split (g x2)) => //; move: (x2); [near: x1|near: y1]. by have /cvg_fct_entourageP := fg; apply. Unshelve. all: by end_near. Qed. -Lemma cvg_switch {U : completeType} +Lemma cvg_switch {d} {U : completeType d} F1 (FF1 : ProperFilter F1) F2 (FF2 : ProperFilter F2) (f : T1 -> T2 -> U) (g : T2 -> U) (h : T1 -> U) : f @ F1 --> g -> (forall x1, f x1 @ F2 --> h x1) -> @@ -628,19 +680,44 @@ Definition uniform_fun {U : Type} (A : set U) (V : Type) : Type := U -> V. Notation "{ 'uniform`' A -> V }" := (@uniform_fun _ A V) : type_scope. Notation "{ 'uniform' U -> V }" := ({uniform` [set: U] -> V}) : type_scope. -Notation "{ 'uniform' A , F --> f }" := - (cvg_to F (nbhs (f : {uniform` A -> _}))) : classical_set_scope. -Notation "{ 'uniform' , F --> f }" := - (cvg_to F (nbhs (f : {uniform _ -> _}))) : classical_set_scope. -Definition sigL_arrow {U : choiceType} (A : set U) (V : uniformType) : +Fact uniform_fdisp {U : Type} (A : set U) : fdisp_t. +Proof. by []. Qed. + +Notation "A .-uniform" := (uniform_fdisp A) (at level 4, format "A .-uniform"). + +Definition sigL_arrow {d} {U : choiceType} (A : set U) (V : uniformType d) : (U -> V) -> arrow_uniform_type A V := @sigL _ V A. -HB.instance Definition _ (U : choiceType) (A : set U) (V : uniformType) := - Uniform.copy {uniform` A -> V} (initial_topology (@sigL_arrow _ A V)). +Definition uniform_topology_def d (U : choiceType) + (A : set U) (V : uniformType d) := + with_fdisp (uniform_fdisp A) (initial_topology (@sigL_arrow _ _ A V)). + +HB.instance Definition _ d (U : choiceType) (A : set U) (V : uniformType d) := + Uniform.copy {uniform` A -> V} (uniform_topology_def A V). + +Notation "{ 'uniform' A , F --> f }" := + (cvg_to (nbhs F) (nbhs (f :> {uniform` A -> _}))) + (only parsing): classical_set_scope. +Notation "{ 'uniform' A , F --> f }" := + (cvg_to F (@nbhs (uniform_fdisp A) _ _ f)) + (only printing): classical_set_scope. +Notation "{ 'uniform' A , F --> f }" := + (cvg_to (nbhs F) (@nbhs (uniform_fdisp A) _ _ f)) + (only printing): classical_set_scope. + +Notation "{ 'uniform' , F --> f }" := + (cvg_to (nbhs F) (nbhs (f :> {uniform _ -> _}))) + (only parsing) : classical_set_scope. +Notation "{ 'uniform' , F --> f }" := + (cvg_to F (@nbhs (uniform_fdisp setT) _ _ f)) + (only printing) : classical_set_scope. +Notation "{ 'uniform' , F --> f }" := + (cvg_to (nbhs F) (@nbhs (uniform_fdisp setT) _ _ f)) + (only printing) : classical_set_scope. Section RestrictedUniformTopology. -Context {U : choiceType} (A : set U) {V : uniformType} . +Context {d} {U : choiceType} (A : set U) {V : uniformType d}. Lemma uniform_nbhs (f : {uniform` A -> V}) P: nbhs f P <-> (exists E, entourage E /\ @@ -657,7 +734,7 @@ case : (pselect (exists (u : U), True)); first last. exact: filterT. case=> u0 _; near=> g; apply: subP => y /mem_set Ay; rewrite -!(sigLE A). move: (SigSub _); near: g. -have := (@cvg_image _ _ (@sigL_arrow _ A V) _ f (nbhs_filter f) +have := (@cvg_image _ _ _ (@sigL_arrow _ _ A V) _ f (nbhs_filter f) (image_sigL (f u0))).1 cvg_id [set h | forall y, E (sigL A f y, h y)]. case. exists [set fg | forall y, E (fg.1 y, fg.2 y)] => //; first by exists E. @@ -667,9 +744,9 @@ by move: rBrE; rewrite eqEsubset; case => [+ _]; apply; exists g. Unshelve. all: by end_near. Qed. Lemma uniform_entourage : - @entourage {uniform` A -> V} = + @entourage _ {uniform` A -> V} = filter_from - (@entourage V) + (@entourage _ V) (fun P => [set fg | forall t : U, A t -> P (fg.1 t, fg.2 t)]). Proof. rewrite eqEsubset; split => P /=. @@ -683,32 +760,49 @@ Qed. End RestrictedUniformTopology. -Lemma restricted_cvgE {U : choiceType} {V : uniformType} +Lemma restricted_cvgE {d} {U : choiceType} {V : uniformType d} (F : set_system (U -> V)) A (f : U -> V) : - {uniform A, F --> f} = (F --> (f : {uniform` A -> V})). + {uniform A, F --> f} = (F --> (f :> {uniform` A -> V})). Proof. by []. Qed. -Lemma pointwise_cvgE {U : Type} {V : topologicalType} +Lemma pointwise_cvgE {d} {U : Type} {V : topologicalType d} (F : set_system (U -> V)) (A : set U) (f : U -> V) : - {ptws, F --> f} = (F --> (f : {ptws U -> V})). + {ptws, F --> f} = (F --> (f :> {ptws U -> V})). Proof. by []. Qed. - -(**md We use this function to help Coq identify the correct notation to use - when printing. Otherwise you get goals like `F --> f -> F --> f`. *) Definition uniform_fun_family {U} V (fam : set U -> Prop) := U -> V. +Fact fam_fdisp {U} (fam : set U -> Prop) : fdisp_t. +Proof. by []. Qed. + +Notation "fam .-fam" := (fam_fdisp fam) + (at level 4, format "fam .-fam") : fdisp_scope. + Notation "{ 'family' fam , U -> V }" := (@uniform_fun_family U V fam). Notation "{ 'family' fam , F --> f }" := - (cvg_to F (@nbhs _ {family fam, _ -> _} f)) : type_scope. + (cvg_to (nbhs F) (nbhs (f :> {family fam, _ -> _}))) + (only parsing) : type_scope. +Notation "{ 'family' fam , F --> f }" := + (cvg_to F (@nbhs fam.-fam _ _ f)) + (only printing) : type_scope. +Notation "{ 'family' fam , F --> f }" := + (cvg_to (nbhs F) (@nbhs fam.-fam _ _ f)) + (only printing) : type_scope. + +Definition fam_topology_def d (U : choiceType) (V : uniformType d) + (fam : set_system U) := + with_fdisp fam.-fam (sup_topology (fun k : sigT fam => + Uniform.class {uniform` projT1 k -> V}) + ). -HB.instance Definition _ {U : choiceType} {V : uniformType} +HB.instance Definition _ {d} {U : choiceType} {V : uniformType d} (fam : set U -> Prop) := - Uniform.copy {family fam, U -> V} (sup_topology (fun k : sigT fam => - Uniform.class {uniform` projT1 k -> V})). + Uniform.copy {family fam, U -> V} (fam_topology_def V fam). Section UniformCvgLemmas. -Context {U : choiceType} {V : uniformType}. +Context {d} {U : choiceType} {V : uniformType d}. + +Import ExplicitNbhsDisplays. Lemma uniform_set1 F (f : U -> V) (x : U) : Filter F -> {uniform [set x], F --> f} = (g x @[g --> F] --> f x). @@ -723,7 +817,7 @@ by apply: filter_app; apply: nearW=> ? /xsectionP ? ? ->. Qed. Lemma uniform_subset_nbhs (f : U -> V) (A B : set U) : - B `<=` A -> nbhs (f : {uniform` A -> V}) `=>` nbhs (f : {uniform` B -> V}). + B `<=` A -> nbhs (f :> {uniform` B -> V}) `<=` nbhs (f :> {uniform` A -> V}). Proof. move => BsubA P /uniform_nbhs [E [entE EsubP]]. apply: (filterS EsubP); apply/uniform_nbhs; exists E; split => //. @@ -788,7 +882,7 @@ by rewrite uniform_entourage; exists X'. Qed. Lemma uniform_nbhsT (f : U -> V) : - (nbhs (f : {uniform U -> V})) = nbhs (f : arrow_uniform_type U V). + nbhs (f :> {uniform U -> V}) = nbhs (f :> arrow_uniform_type U V). Proof. rewrite eqEsubset; split=> A. case/uniform_nbhs => E [entE] /filterS; apply. @@ -859,7 +953,7 @@ Qed. End UniformCvgLemmas. -Lemma uniform_restrict_cvg {U : choiceType} {V : puniformType} +Lemma uniform_restrict_cvg {d} {U : choiceType} {V : puniformType d} (F : set_system (U -> V)) (f : U -> V) A : Filter F -> {uniform A, F --> f} <-> {uniform, restrict A @ F --> restrict A f}. Proof. @@ -879,15 +973,16 @@ move=> FF; rewrite cvg_sigL; split. by have := R u I; rewrite /patch Au. Qed. - Section FamilyConvergence. -Lemma fam_cvgE {U : choiceType} {V : uniformType} (F : set_system (U -> V)) - (f : U -> V) fam : - {family fam, F --> f} = (F --> (f : {family fam, U -> V})). +Import ExplicitNbhsDisplays. + +Lemma fam_cvgE {d} {U : choiceType} {V : uniformType d} + (F : set_system (U -> V)) (f : U -> V) fam : + {family fam, F --> f} = (F --> (f :> {family fam, U -> V})). Proof. by []. Qed. -Lemma fam_nbhs {U : choiceType} {V : uniformType} (fam : set U -> Prop) +Lemma fam_nbhs {d} {U : choiceType} {V : uniformType d} (fam : set U -> Prop) (A : set U) (E : set (V * V)) (f : {family fam, U -> V}) : entourage E -> fam A -> nbhs f [set g | forall y, A y -> E (f y, g y)]. Proof. @@ -895,10 +990,10 @@ move=> entE famA; have /fam_cvgP /(_ A) : (nbhs f --> f) by []; apply => //. by apply uniform_nbhs; exists E; split. Qed. -Lemma fam_compact_nbhs {U : topologicalType} {V : uniformType} +Lemma fam_compact_nbhs {d d'} {U : topologicalType d} {V : uniformType d'} (A : set U) (O : set V) (f : {family compact, U -> V}) : open O -> f @` A `<=` O -> compact A -> continuous f -> - nbhs (f : {family compact, U -> V}) [set g | forall y, A y -> O (g y)]. + nbhs (f :> {family compact, U -> V}) [set g | forall y, A y -> O (g y)]. Proof. move=> oO fAO /[dup] cA /compact_near_coveringP/near_covering_withinP cfA ctsf. near=> z => /=; (suff: A `<=` [set y | O (z y)] by exact); near: z. @@ -915,12 +1010,17 @@ Unshelve. all: by end_near. Qed. End FamilyConvergence. +Fact compact_open_fdisp : fdisp_t. +Proof. by []. Qed. + +Notation "'compact_open'" := compact_open_fdisp (only printing) : fdisp_scope. + (**md It turns out `{family compact, U -> V}` can be generalized to only assume `topologicalType` on `V`. This topology is called the compact-open topology. This topology is special because it is the _only_ topology that will allow `curry`/`uncurry` to be continuous. *) Section compact_open. -Context {T U : topologicalType}. +Context {d d'} {T : topologicalType d} {U : topologicalType d'}. Definition compact_open : Type := T -> U. @@ -947,7 +1047,8 @@ Qed. HB.instance Definition _ := Choice.on compact_openK. -HB.instance Definition _ := hasNbhs.Build compact_openK compact_openK_nbhs. +HB.instance Definition _ := hasNbhs.Build default_fdisp + compact_openK compact_openK_nbhs. Definition compact_open_of_nbhs := [set A : set compact_openK | A `<=` nbhs^~ A]. @@ -967,24 +1068,27 @@ Lemma compact_openK_openE_subproof : Proof. by []. Qed. HB.instance Definition _ := - Nbhs_isTopological.Build compact_openK compact_openK_nbhs_filter + Nbhs_isTopological.Build _ compact_openK compact_openK_nbhs_filter compact_openK_nbhsE_subproof compact_openK_openE_subproof. End compact_open_setwise. -Definition compact_open_def := - sup_topology (fun i : sigT (@compact T) => - Topological.class (@compact_openK (projT1 i))). +Definition compact_open_def := with_fdisp compact_open_fdisp ( + sup_topology (fun i : sigT (@compact _ T) => + Topological.class (@compact_openK (projT1 i))) + ). HB.instance Definition _ := Nbhs.copy compact_open compact_open_def. -HB.instance Definition _ : Nbhs_isTopological compact_open := +HB.instance Definition _ : Nbhs_isTopological _ compact_open := Topological.copy compact_open compact_open_def. +Import ExplicitNbhsDisplays. + Lemma compact_open_cvgP (F : set_system compact_open) (f : compact_open) : Filter F -> - F --> f <-> forall K O, @compact T K -> @open U O -> f @` K `<=` O -> + F --> f <-> forall K O, @compact _ T K -> @open _ U O -> f @` K `<=` O -> F [set g | g @` K `<=` O]. Proof. move=> FF; split. @@ -994,7 +1098,7 @@ by move/filterS; apply; exact: fko. Qed. Lemma compact_open_open (K : set T) (O : set U) : - compact K -> open O -> open ([set g | g @` K `<=` O] : set compact_open). + compact K -> open O -> open ([set g | g @` K `<=` O] :> set compact_open). Proof. pose C := [set g | g @` K `<=` O]; move=> cptK oO. exists [set C]; last by rewrite bigcup_set1. @@ -1004,21 +1108,30 @@ Qed. End compact_open. -HB.instance Definition _ {U : topologicalType} {V : ptopologicalType} K := - Pointed.on (@compact_openK U V K). +HB.instance Definition _ {d d'} + {U : topologicalType d} {V : ptopologicalType d'} K := + Pointed.on (@compact_openK _ _ U V K). -HB.instance Definition _ {U : topologicalType} {V : ptopologicalType} := - Pointed.on (@compact_open U V). +HB.instance Definition _ {d d'} + {U : topologicalType d} {V : ptopologicalType d'} := + Pointed.on (@compact_open _ _ U V). -Notation "{ 'compact-open' , U -> V }" := (@compact_open U V). +Notation "{ 'compact-open' , U -> V }" := (@compact_open _ _ U V). +Notation "{ 'compact-open' , F --> f }" := + (cvg_to (nbhs F) (nbhs (f :> {compact-open, _ -> _}))) + (only parsing). +Notation "{ 'compact-open' , F --> f }" := + (cvg_to F (@nbhs compact_open_fdisp _ _ f)) + (only printing). Notation "{ 'compact-open' , F --> f }" := - (F --> (f : @compact_open _ _)). + (cvg_to (nbhs F) (@nbhs compact_open_fdisp _ _ f)) + (only printing). Section compact_open_uniform. -Context {U : topologicalType} {V : puniformType}. +Context {d d'} {U : topologicalType d} {V : puniformType d'}. -Let small_ent_sub := @small_set_sub _ (@entourage V). +Let small_ent_sub := @small_set_sub _ (@entourage _ V). Lemma compact_open_fam_compactP (f : U -> V) (F : set_system (U -> V)) : continuous f -> Filter F -> @@ -1034,7 +1147,7 @@ move: oE; rewrite openE => /(_ _ Ekf); case => A [J entJ] EKR KfE. near=> z; apply/KfE/xsectionP/EKR => -[u Kp]; rewrite /sigL_arrow /= /set_val /= /eqincl. (have Ku : K u by rewrite inE in Kp); move: u Ku {D Kp}; near: z. move/compact_near_coveringP/near_covering_withinP : (cptK); apply. -move=> u Ku; near (powerset_filter_from (@entourage V)) => E'. +move=> u Ku; near (powerset_filter_from (@entourage _ V)) => E'. have entE' : entourage E' by exact: (near (near_small_set _)). pose C := f @^-1` xsection E' (f u). pose B := \bigcup_(z in K `&` closure C) interior (xsection E' (f z)). @@ -1069,19 +1182,24 @@ Unshelve. all: by end_near. Qed. End compact_open_uniform. Module ArrowAsCompactOpen. -HB.instance Definition _ (U : topologicalType) (V : topologicalType) := - Topological.copy (U -> V) {compact-open, U -> V}. - -HB.instance Definition _ (U : topologicalType) (V : topologicalType) := - Topological.copy (continuousType U V) - (initial_topology (id : (continuousType U V) -> (U -> V)) ). +HB.instance Definition _ d d' (U : topologicalType d) (V : topologicalType d') + := Topological.copy (U -> V) {compact-open, U -> V}. + +HB.instance Definition _ d d' (U : topologicalType d) (V : topologicalType d') + := + Topological.copy + (continuousType U V) + (with_fdisp + default_fdisp + (initial_topology (id : (continuousType U V) -> (U -> V)))). End ArrowAsCompactOpen. -Definition compactly_in {U : topologicalType} (A : set U) := +Definition compactly_in {d} {U : topologicalType d} (A : set U) := [set B | B `<=` A /\ compact B]. -Lemma compact_cvg_within_compact {U : topologicalType} {V : uniformType} - (C : set U) (F : set_system (U -> V)) (f : U -> V) : +Lemma compact_cvg_within_compact {d d'} + {U : topologicalType d} {V : uniformType d'} + (C : set U) (F : set_system (U -> V)) (f : U -> V) : Filter F -> compact C -> {uniform C, F --> f} <-> {family compactly_in C, F --> f}. Proof. @@ -1093,8 +1211,8 @@ Qed. Section UniformContinuousLimits. -Lemma uniform_limit_continuous {U : topologicalType} {V : uniformType} - (F : set_system (U -> V)) (f : U -> V) : +Lemma uniform_limit_continuous {d d'} {U : topologicalType d} + {V : uniformType d'} (F : set_system (U -> V)) (f : U -> V) : ProperFilter F -> (\forall g \near F, continuous (g : U -> V)) -> {uniform, F --> f} -> continuous f. Proof. @@ -1107,23 +1225,24 @@ apply/Ff/uniform_nbhs; exists (split_ent (split_ent A))^-1%relation. by split; [exact: entourage_inv | move=> g fg; near_simpl; near=> z; exact: fg]. Unshelve. all: end_near. Qed. -Lemma uniform_limit_continuous_subspace {U : topologicalType} {V : puniformType} - (K : set U) (F : set_system (U -> V)) (f : subspace K -> V) : +Lemma uniform_limit_continuous_subspace {d d'} + {U : topologicalType d} {V : puniformType d'} + (K : set U) (F : set_system (U -> V)) (f : subspace K -> V) : ProperFilter F -> (\forall g \near F, continuous (g : subspace K -> V)) -> {uniform K, F --> f} -> {within K, continuous f}. Proof. -move=> PF ctsF Ff; apply: (@subspace_eq_continuous _ _ _ (restrict K f)). +move=> PF ctsF Ff; apply: (@subspace_eq_continuous _ _ _ _ _ (restrict K f)). by rewrite /restrict => ? ->. -apply: (@uniform_limit_continuous (subspace K) _ (restrict K @ F) _). +apply: (@uniform_limit_continuous _ _ (subspace K) _ (restrict K @ F) _). apply: (filterS _ ctsF) => g; apply: subspace_eq_continuous. by rewrite /restrict => ? ->. -by apply (@uniform_restrict_cvg _ _ F ) => //; exact: PF. +by apply (@uniform_restrict_cvg _ _ _ F) => //; exact: PF. Qed. End UniformContinuousLimits. Section UniformPointwise. -Context {U : topologicalType} {V : uniformType}. +Context {d d'} {U : topologicalType d} {V : uniformType d'}. Definition singletons {T : Type} := [set [set x] | x in [set: T]]. @@ -1131,7 +1250,7 @@ Lemma pointwise_cvg_family_singleton F (f: U -> V): Filter F -> {ptws, F --> f} = {family @singletons U, F --> f}. Proof. move=> FF; apply/propext. -rewrite (@fam_cvgP _ _ singletons). (* BUG: slowdown if no arguments *) +rewrite (@fam_cvgP _ _ _ singletons). (* BUG: slowdown if no arguments *) rewrite cvg_sup; split. move=> + A [x _ <-] => /(_ x); rewrite uniform_set1. rewrite cvg_image; first by rewrite eqEsubset; split=> v // _; exists (cst v). @@ -1163,9 +1282,12 @@ Qed. End UniformPointwise. Section ArzelaAscoli. -Context {X : topologicalType} {Y : puniformType} {hsdf : hausdorff_space Y}. +Context {d d'} {X : topologicalType d} {Y : puniformType d'}. +Hypothesis hsdf : hausdorff_space Y. Implicit Types (I : Type). +Import ExplicitNbhsDisplays. + (** The key condition in Arzela-Ascoli that, like uniform continuity, moves a quantifier around so all functions have the same "deltas": *) Definition equicontinuous {I} (W : set I) (d : I -> (X -> Y)) := @@ -1216,7 +1338,7 @@ by case: (WsubV (fW i)); [exists i | move=> j Vj <-; exists j]. Qed. Lemma pointwise_precompact_precompact {I} (W : set I) (fW : I -> (X -> Y)) : - pointwise_precompact W fW -> precompact ((fW @` W) : set {ptws X -> Y}). + pointwise_precompact W fW -> precompact ((fW @` W) :> set {ptws X -> Y}). Proof. rewrite precompactE => ptwsPreW. pose K := fun x => closure [set fW i x | i in W]. @@ -1231,8 +1353,8 @@ by apply: compact_closed => //=; exact: hausdorff_product. Qed. Lemma uniform_pointwise_compact (W : set (X -> Y)) : - compact (W : set (@uniform_fun_family X Y compact)) -> - compact (W : set {ptws X -> Y}). + compact (W :> set (@uniform_fun_family X Y compact)) -> + compact (W :> set {ptws X -> Y}). Proof. rewrite [x in x _ -> _]compact_ultra [x in _ -> x _]compact_ultra. move=> + F UF FW => /(_ F UF FW) [h [Wh Fh]]; exists h; split => //. @@ -1245,11 +1367,11 @@ Proof. move=> + x; rewrite ?precompactE => pcptW. have : compact (proj x @` (closure W)). apply: continuous_compact => //; apply: continuous_subspaceT=> g. - move=> E nbhsE; have := (@proj_continuous _ _ x g E nbhsE). - exact: (@pointwise_cvg_compact_family _ _ (nbhs g)). + move=> E nbhsE; have := (@proj_continuous _ _ _ x g E nbhsE). + exact: (@pointwise_cvg_compact_family _ _ _ _ (nbhs g)). move=> /[dup]/(compact_closed hsdf)/closure_id -> /subclosed_compact. apply; first exact: closed_closure. -by apply/closureS/image_subset; exact: (@subset_closure _ W). +by apply/closureS/image_subset; exact: (@subset_closure _ _ W). Qed. Lemma pointwise_cvg_entourage (x : X) (f : {ptws X -> Y}) E : @@ -1270,13 +1392,13 @@ have ? : ProperFilter (within W (nbhs (f : {ptws X -> Y}))). exact: within_nbhs_proper. (* TODO: This ProperFilter _ also used to infer correctly. *) near (within W (nbhs (f : {ptws X -> Y}))) => g. near: g; rewrite near_withinE; near_simpl; near=> g => Wg. -apply: (@entourage_split _ (g x)) => //. +apply: (@entourage_split _ _ (g x)) => //. exact: (near (pointwise_cvg_entourage _ _ _)). -apply: (@entourage_split _ (g y)) => //; first exact: (near (@ectsW x _ _)). +apply: (@entourage_split _ _ (g y)) => //; first exact: (near (@ectsW x _ _)). by apply/entourage_sym; exact: (near (pointwise_cvg_entourage _ _ _)). Unshelve. all: by end_near. Qed. -Definition small_ent_sub := @small_set_sub _ (@entourage Y). +Definition small_ent_sub := @small_set_sub _ (@entourage _ Y). Lemma pointwise_compact_cvg (F : set_system {ptws X -> Y}) (f : {ptws X -> Y}) : ProperFilter F -> @@ -1296,8 +1418,9 @@ apply/fam_cvgP => K ? U /=; rewrite uniform_nbhs => [[E [eE EsubU]]]. suff : \forall g \near within W (nbhs (f : {ptws X -> Y})), forall y, K y -> E (f y, g y). rewrite near_withinE; near_simpl => N; apply: (filter_app _ _ FW). + have Ff : Filter (nbhs f) by exact: nbhs_filter. by apply: ptwsF; near=> g => ?; apply: EsubU; apply: (near N g). -near (powerset_filter_from (@entourage Y)) => E'. +near (powerset_filter_from (@entourage _ Y)) => E'. have entE' : entourage E' by exact: (near (near_small_set _)). pose Q := fun (h : X -> Y) x => E' (f x, h x). apply: (iffLR (compact_near_coveringP K)) => // x Kx. @@ -1305,7 +1428,7 @@ near=> y g => /=. apply: (entourage_split (f x) eE). apply entourage_sym; apply: (near (small_ent_sub _) E') => //. exact: (near (ectsW x E' entE') y). -apply: (@entourage_split _ (g x)) => //. +apply: (@entourage_split _ _ (g x)) => //. apply: (near (small_ent_sub _) E') => //. near: g; near_simpl; apply: (@cvg_within _ (nbhs (f : {ptws X -> Y}))). exact: pointwise_cvg_entourage. @@ -1316,8 +1439,8 @@ Unshelve. all: end_near. Qed. Lemma pointwise_compact_closure (W : set (X -> Y)) : equicontinuous W id -> - closure (W : set {family compact, X -> Y}) = - closure (W : set {ptws X -> Y}). + closure (W :> set {family compact, X -> Y}) = + closure (W :> set {ptws X -> Y}). Proof. rewrite ?closureEcvg // predeqE => ? ?. split; move=> [F PF [Fx WF]]; (exists F; last split) => //. @@ -1332,7 +1455,7 @@ Qed. Lemma pointwise_precompact_equicontinuous (W : set (X -> Y)) : pointwise_precompact W id -> equicontinuous W id -> - precompact (W : set {family compact, X -> Y }). + precompact (W :> set {family compact, X -> Y }). Proof. move=> /pointwise_precompact_precompact + ectsW. rewrite ?precompactE compact_ultra compact_ultra pointwise_compact_closure //. @@ -1348,18 +1471,18 @@ Hypothesis lcptX : locally_compact [set: X]. Lemma compact_equicontinuous (W : set {family compact, X -> Y}) : (forall f, W f -> continuous f) -> - compact (W : set {family compact, X -> Y}) -> + compact (W :> set {family compact, X -> Y}) -> equicontinuous W id. Proof. move=> ctsW cptW x E entE. have [//|U UWx [cptU clU]] := @lcptX x; rewrite withinET in UWx. -near (powerset_filter_from (@entourage Y)) => E'. +near (powerset_filter_from (@entourage _ Y)) => E'. have entE' : entourage E' by exact: (near (near_small_set _)). pose Q := fun (y : X) (f : {family compact, X -> Y}) => E' (f x, f y). apply: (iffLR (compact_near_coveringP W)) => // f Wf; near=> g y => /=. apply: (entourage_split (f x) entE). apply/entourage_sym; apply: (near (small_ent_sub _) E') => //. - exact: (near (fam_nbhs _ entE' (@compact_set1 _ x)) g). + exact: (near (fam_nbhs _ entE' (@compact_set1 _ _ x)) g). apply: (entourage_split (f y) (entourage_split_ent entE)). apply: (near (small_ent_sub _) E') => //. by apply/xsectionP; near: y; apply: (@ctsW f Wf x); exact: nbhs_entourage. @@ -1369,10 +1492,10 @@ Unshelve. all: end_near. Qed. Lemma precompact_equicontinuous (W : set {family compact, X -> Y}) : (forall f, W f -> continuous f) -> - precompact (W : set {family compact, X -> Y}) -> + precompact (W :> set {family compact, X -> Y}) -> equicontinuous W id. Proof. -move=> pcptW ctsW; apply: (equicontinuous_subset_id (@subset_closure _ W)). +move=> pcptW ctsW; apply: (equicontinuous_subset_id (@subset_closure _ _ W)). apply: compact_equicontinuous; last by rewrite -precompactE. move=> f; rewrite closureEcvg => [[G PG [Gf GW]]] x B /=. rewrite -nbhs_entourageE => -[E entE] /filterS; apply; near_simpl. @@ -1393,7 +1516,7 @@ Theorem Ascoli (W : set {family compact, X -> Y}) : locally_compact [set: X] -> pointwise_precompact W id /\ equicontinuous W id <-> (forall f, W f -> continuous f) /\ - precompact (W : set {family compact, X -> Y}). + precompact (W :> set {family compact, X -> Y}). Proof. move=> lcpt; split => [[Wid ectsW]|[fWf]pcptW]. split=> [?|]; first exact: equicontinuous_continuous. @@ -1408,7 +1531,8 @@ Section currying. Local Import ArrowAsCompactOpen. Section cartesian_closed. -Context {U V W : topologicalType}. +Context {d d' d'' : fdisp_t} {U : topologicalType d} + {V : topologicalType d'} {W : topologicalType d''}. (**md In this section, we consider under what conditions \ `[f in U ~> V ~> W | continuous f /\ forall u, continuous (f u)]` \ @@ -1454,7 +1578,7 @@ by rewrite -surjective_pairing. Qed. Lemma continuous_uncurry_regular (f : U -> V -> W) : - locally_compact [set: V] -> @regular_space V -> continuous f -> + locally_compact [set: V] -> @regular_space _ V -> continuous f -> (forall u, continuous (f u)) -> continuous (uncurry f). Proof. move=> lcV reg cf cfp /= [u v] D; rewrite /= nbhsE => -[O [oO Ofuv]] /filterS. @@ -1480,8 +1604,8 @@ move=> v; have [B] := @lcV v I; rewrite withinET => Bv [cptB clB]. by move=> z; exact: (compact_regular _ cptB). Qed. -Lemma curry_continuous (f : (U * V)%type -> W) : continuous f -> @regular_space U -> - {for f, continuous curry}. +Lemma curry_continuous (f : (U * V)%type -> W) : continuous f -> + @regular_space _ U -> {for f, continuous curry}. Proof. move=> ctsf regU; apply/compact_open_cvgP. by apply: fmap_filter; exact: nbhs_filter. @@ -1517,7 +1641,7 @@ by exists (a, b); split => //; split => //; exact/subset_closure. Unshelve. all: by end_near. Qed. Lemma uncurry_continuous (f : U -> V -> W) : - locally_compact [set: V] -> @regular_space V -> @regular_space U -> + locally_compact [set: V] -> @regular_space _ V -> @regular_space _ U -> continuous f -> (forall u, continuous (f u)) -> {for f, continuous uncurry}. Proof. @@ -1563,7 +1687,7 @@ End cartesian_closed. End currying. Section big_continuous. -Context {U : topologicalType} {I : Type} +Context {d} {U : topologicalType d} {I : Type} (op : U -> U -> U) (x0 : U) (P : pred I). Hypothesis cont_op : continuous (fun x : U * U => op x.1 x.2). @@ -1588,7 +1712,7 @@ apply: (@cvg_comp _ _ _ by apply: cvg_pair => //; exact: cvg_f. Qed. -Lemma continuous_big {T : topologicalType} (r : seq I) +Lemma continuous_big {d'} {T : topologicalType d'} (r : seq I) (F : I -> T -> U) : (forall i, P i -> continuous (F i)) -> continuous (fun x => \big[op/x0]_(i <- r | P i) F i x). @@ -1596,32 +1720,34 @@ Proof. by move=> F_cont x; apply: cvg_big => // i /F_cont; exact. Qed. -Lemma within_continuous_big {T : topologicalType} (A : set T) (r : seq I) - (F : I -> T -> U) : +Lemma within_continuous_big {d'} {T : topologicalType d'} (A : set T) + (r : seq I) (F : I -> T -> U) : (forall i, P i -> {within A, continuous (F i)}) -> {within A, continuous (fun x => \big[op/x0]_(i <- r | P i) F i x)}. Proof. by move=> ? ?; exact: continuous_big. Qed. End big_continuous. -Definition eval {X Y : topologicalType} : continuousType X Y * X -> Y := +Definition eval {d d'} {X : topologicalType d} {Y : topologicalType d'} : + continuousType X Y * X -> Y := uncurry (id : continuousType X Y -> (X -> Y)). Section composition. Local Import ArrowAsCompactOpen. -Lemma eval_continuous {X Y : topologicalType} : - locally_compact [set: X] -> regular_space X -> continuous (@eval X Y). +Lemma eval_continuous {d d'} {X : topologicalType d} {Y : topologicalType d'} : + locally_compact [set: X] -> regular_space _ X -> continuous (@eval _ _ X Y). Proof. move=> lcX rsX; apply: continuous_uncurry_regular => //. exact: initial_continuous. by move=> ?; exact: continuous_fun. Qed. -Lemma compose_continuous {X Y Z : topologicalType} : - locally_compact [set: X] -> @regular_space X -> - locally_compact [set: Y] -> @regular_space Y -> +Lemma compose_continuous {d d' d''} {X : topologicalType d} + {Y : topologicalType d'} {Z : topologicalType d''} : + locally_compact [set: X] -> @regular_space _ X -> + locally_compact [set: Y] -> @regular_space _ Y -> continuous (uncurry (comp : continuousType Y Z -> continuousType X Y -> continuousType X Z)). Proof. @@ -1639,7 +1765,7 @@ pose h (fxg : continuousType X Y * X * continuousType Y Z) : Z := have <- : h = uncurry F \o prodAr \o swap. by rewrite /h/g/uncurry/swap/F funeqE => -[[]]. rewrite /h. -apply: (@continuous2_cvg _ _ _ _ _ _ snd (eval \o fst) (curry eval)). +apply: (@continuous2_cvg _ _ _ _ _ _ _ _ _ snd (eval \o fst) (curry eval)). - by apply: continuous_curry_cvg; exact: eval_continuous. - exact: cvg_snd. - by apply: cvg_comp; [exact: cvg_fst | exact: eval_continuous]. diff --git a/theories/topology_theory/initial_topology.v b/theories/topology_theory/initial_topology.v index c9d2d88948..f34eb30df9 100644 --- a/theories/topology_theory/initial_topology.v +++ b/theories/topology_theory/initial_topology.v @@ -40,6 +40,8 @@ From mathcomp Require Import pseudometric_structure. Import Order.TTheory GRing.Theory Num.Theory. +Reserved Notation "f .-initial" (at level 4, format "f .-initial"). + Unset SsrOldRewriteGoalsOrder. (* remove the line when requiring MathComp >= 2.6 *) Set Implicit Arguments. Unset Strict Implicit. @@ -48,11 +50,17 @@ Unset Printing Implicit Defensive. Local Open Scope classical_set_scope. Local Open Scope ring_scope. +Fact initial_fdisp (S T : Type) (f : S -> T) : fdisp_t. +Proof. by []. Qed. + +Notation "f .-initial" := (initial_fdisp f) : fdisp_scope. + Definition initial_topology {S : Type} {T : Type} (f : S -> T) : Type := S. Section Initial_Topology. -Variable (S : choiceType) (T : topologicalType) (f : S -> T). +Context (d : fdisp_t) (S : choiceType) (T : topologicalType d). +Context (f : S -> T). Local Notation W := (initial_topology f). Definition initial_open := [set f @^-1` A | A in open]. @@ -81,7 +89,8 @@ Qed. HB.instance Definition _ := Choice.on W. HB.instance Definition _ := - isOpenTopological.Build W initial_opT initial_opI initial_op_bigU. + isOpenTopological.Build (initial_fdisp f) W + initial_opT initial_opI initial_op_bigU. Lemma initial_continuous : continuous (f : W -> T). Proof. by apply/continuousP => A ?; exists A. Qed. @@ -111,35 +120,37 @@ End Initial_Topology. (*#[deprecated(since="mathcomp-analysis 1.17.0", note="renamed `initial_open`")] Notation wopen := initial_open (only parsing).*) -HB.instance Definition _ (S : pointedType) (T : topologicalType) (f : S -> T) := - Pointed.on (initial_topology f). +HB.instance Definition _ d (S : pointedType) (T : topologicalType d) + (f : S -> T) := Pointed.on (initial_topology f). Definition sub_initial_topology (V : Type) (S : pred V) (U : subChoiceType S) : Type := initial_topology (\val : U -> V). Section SubType_isSubTopological. -Context (V : topologicalType) (S : pred V) (U : subChoiceType S). +Context (d : fdisp_t). +Context (V : topologicalType d) (S : pred V) (U : subChoiceType S). Local Notation T := (sub_initial_topology U). HB.instance Definition _ := SubChoice.on T. HB.instance Definition _ := Nbhs.on T. HB.instance Definition _ := Topological.on T. -Let top_continuous_valE : continuous (val : T -> V). +Let top_continuous_valE : continuous (\val : T -> V). Proof. exact: initial_continuous. Qed. -HB.instance Definition _ := @isSubNbhs.Build V S T top_continuous_valE. +HB.instance Definition _ := @isSubNbhs.Build _ _ V S T top_continuous_valE. End SubType_isSubTopological. Section initial_uniform. Local Open Scope relation_scope. -Variable (pS : choiceType) (U : uniformType) (f : pS -> U). +Context (d : fdisp_t) (pS : choiceType) (U : uniformType d). +Context (f : pS -> U). Let S := initial_topology f. Definition initial_ent : set_system (S * S) := - filter_from (@entourage U) (fun V => (map_pair f)@^-1` V). + filter_from (@entourage _ U) (fun V => (map_pair f)@^-1` V). Let initial_ent_filter : Filter initial_ent. Proof. @@ -174,36 +185,38 @@ rewrite predeq2E => x V; split. by move=> ? ?; exact/BsubV/WsubB. case=> W [V' entV' V'subW] /filterS; apply. have : nbhs (f x) (xsection V' (f x)) by apply/nbhsP; exists V'. -rewrite (@nbhsE U) => [[O [openU Ofx Osub]]]. +rewrite (@nbhsE _ U) => [[O [openU Ofx Osub]]]. (exists (f @^-1` O); repeat split => //); first by exists O => //. by move=> w ?; apply/mem_set; apply: V'subW; apply/set_mem; exact: Osub. Qed. -HB.instance Definition _ := @Nbhs_isUniform.Build (initial_topology f) +HB.instance Definition _ := @Nbhs_isUniform.Build + _ (initial_topology f) initial_ent initial_ent_filter initial_ent_refl initial_ent_inv initial_ent_split initial_ent_nbhs. End initial_uniform. Section initial_unif_continuous. -Context {T : choiceType} {U : uniformType} (f : T -> U). +Context {d : fdisp_t} {T : choiceType} {U : uniformType d} (f : T -> U). -Lemma initial_unif_continuous : unif_continuous (f : initial_topology f -> U). +Lemma initial_unif_continuous : + unif_continuous (f : initial_topology f -> U). Proof. by move=> A entA; by exists A. Qed. -Lemma initial_unif_continuous_comp - (V : uniformType) (g : V -> initial_topology f) : +Lemma initial_unif_continuous_comp d' + (V : uniformType d') (g : V -> initial_topology f) : unif_continuous (f \o g : V -> U) -> unif_continuous g. Proof. by move=> fg /= A [B entB BA]; apply: filterS _ _ BA _; exact: fg. Qed. -Lemma initial_unif_continuous_comp_fst (V : uniformType) : +Lemma initial_unif_continuous_comp_fst d' (V : uniformType d') : unif_continuous (fun x : initial_topology f * V => f x.1). Proof. by apply: unif_continuous_comp; [exact: fst_unif_continuous|exact: initial_unif_continuous]. Qed. -Lemma initial_unif_continuous_comp_snd (V : uniformType) : +Lemma initial_unif_continuous_comp_snd d' (V : uniformType d') : unif_continuous (fun x : V * initial_topology f => f x.2). Proof. by apply: unif_continuous_comp; @@ -212,12 +225,12 @@ Qed. End initial_unif_continuous. -HB.instance Definition _ (pS : pointedType) (U : uniformType) (f : pS -> U) := - Pointed.on (initial_topology f). +HB.instance Definition _ (d : fdisp_t) (pS : pointedType) + (U : uniformType d) (f : pS -> U) := Pointed.on (initial_topology f). Section initial_pseudoMetric. -Context {R : realType} (pS : choiceType) (U : pseudoMetricType R) . -Variable (f : pS -> U). +Context (d : fdisp_t) {R : realType} (U : pseudoMetricType d R). +Context (pS : choiceType) (f : pS -> U). Notation S := (initial_topology f). @@ -251,9 +264,10 @@ rewrite eqEsubset; split; apply/filter_fromP. - by move=> e ?; exists [set xy | ball xy.1 e xy.2] => //; exists e => /=. Qed. -HB.instance Definition _ := Uniform_isPseudoMetric.Build R S - initial_pseudo_metric_ball_center (fun _ _ _ => @ball_sym _ _ _ _ _) - (fun _ _ _ _ _ => @ball_triangle _ _ _ _ _ _ _) +HB.instance Definition _ := Uniform_isPseudoMetric.Build _ R S + initial_pseudo_metric_ball_center + (fun _ _ _ => @ball_sym _ _ _ _ _ _) + (fun _ _ _ _ _ => @ball_triangle _ _ _ _ _ _ _ _) initial_pseudo_metric_entourageE. Lemma initial_ballE (e : R) (x : S) : f @^-1` (ball (f x) e) = ball x e. @@ -267,12 +281,13 @@ End initial_pseudoMetric. Consider `[0,1[ | {2}` as a subset of `[0,3]` for an example *) Section initial_order_refine. -Context {d} {X : orderTopologicalType d} {Y : subType X}. +Context {td : fdisp_t} {od : Order.disp_t}. +Context {X : orderTopologicalType td od} {Y : subType X}. -Let OrdU : orderTopologicalType d := order_topology (sub_type Y). -Let InitialU : topologicalType := @initial_topology (sub_type Y) X val. +Let OrdU : orderTopologicalType _ od := order_topology (sub_type Y). +Let InitialU : topologicalType _ := initial_topology (val : sub_type Y -> X). -Lemma open_order_initial (U : set Y) : @open OrdU U -> @open InitialU U. +Lemma open_order_initial (U : set Y) : @open _ OrdU U -> @open _ InitialU U. Proof. rewrite ?openE /= /interior => + x Ux => /(_ x Ux); rewrite itv_nbhsE /=. move=> [][][[]l|[]] [[]r|[]][]//= _ xlr /filterS; apply. @@ -290,7 +305,8 @@ Qed. End initial_order_refine. -Lemma continuous_comp_initial {Y : choiceType} {X Z : topologicalType} +Lemma continuous_comp_initial {d d' : fdisp_t} {Y : choiceType} + {X : topologicalType d} {Z : topologicalType d'} (w : Y -> Z) (f : X -> initial_topology w) : continuous (w \o f) -> continuous f. Proof. diff --git a/theories/topology_theory/matrix_topology.v b/theories/topology_theory/matrix_topology.v index fda78c4006..ee1fd6d3f3 100644 --- a/theories/topology_theory/matrix_topology.v +++ b/theories/topology_theory/matrix_topology.v @@ -28,7 +28,7 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section matrix_Topology. -Variables (m n : nat) (T : topologicalType). +Variables (d : fdisp_t) (m n : nat) (T : topologicalType d). Implicit Types M : 'M[T]_(m, n). @@ -52,14 +52,15 @@ move=> [P M_P sPA]; exists (fun i j => (P i j)°). by move=> ? ?; exists P. Qed. -HB.instance Definition _ := Nbhs_isNbhsTopological.Build 'M[T]_(m, n) +HB.instance Definition _ := Nbhs_isNbhsTopological.Build + _ 'M[T]_(m, n) mx_nbhs_filter mx_nbhs_singleton mx_nbhs_nbhs. End matrix_Topology. Section matrix_Uniform. Local Open Scope relation_scope. -Variables (m n : nat) (T : uniformType). +Variables (d : fdisp_t) (m n : nat) (T : uniformType d). Implicit Types A : set ('M[T]_(m, n) * 'M[T]_(m, n)). @@ -119,12 +120,13 @@ move=> [B [C entC sCB] sBA]; exists (fun i j => xsection (C i j) (M i j)). by move=> N CMN; apply/sBA; apply/xsectionP/sCB => ? ?; exact/xsectionP/CMN. Qed. -HB.instance Definition _ := Nbhs_isUniform.Build 'M[T]_(m, n) +HB.instance Definition _ := Nbhs_isUniform.Build + _ 'M[T]_(m, n) mx_ent_filter mx_ent_refl mx_ent_inv mx_ent_split mx_ent_nbhsE. End matrix_Uniform. -Lemma cvg_mx_entourageP (T : puniformType) m n (F : set_system 'M[T]_(m,n)) +Lemma cvg_mx_entourageP d (T : puniformType d) m n (F : set_system 'M[T]_(m,n)) (FF : Filter F) (M : 'M[T]_(m,n)) : F --> M <-> forall A, entourage A -> \forall N \near F, @@ -145,8 +147,9 @@ by apply: filter_bigI => ??; apply: entP. Unshelve. all: by end_near. Qed. Section matrix_PointedTopology. -Variables (m n : nat). -HB.instance Definition _ (T : ptopologicalType) := Filtered.on 'M[T]_(m, n). +Variables (d : fdisp_t) (m n : nat). +HB.instance Definition _ (T : ptopologicalType d) := + Filtered.on 'M[T]_(m, n). (*HB.instance Definition _ (T : ptopologicalType) := Pointed.on 'M[T]_(m, n).*) (* generates Warning: HB: no new instance is generated [HB.no-new-instance,HB,elpi,default] *) (*HB.instance Definition _ (T : ptopologicalType) := @@ -157,13 +160,13 @@ HB.instance Definition _ (T : ptopologicalType) := Filtered.on 'M[T]_(m, n). (* generates Warning: HB: no new instance is generated [HB.no-new-instance,HB,elpi,default] *) (*HB.instance Definition _ (T : uniformType) := Uniform.on 'M[T]_(m, n).*) (* generates Warning: HB: no new instance is generated [HB.no-new-instance,HB,elpi,default] *) -HB.instance Definition _ (T : puniformType) := Pointed.on 'M[T]_(m, n). +HB.instance Definition _ (T : puniformType d) := Pointed.on 'M[T]_(m, n). (*HB.instance Definition _ (T : puniformType) := PointedUniform.on 'M[T]_(m, n).*) (* generates Warning: HB: no new instance is generated [HB.no-new-instance,HB,elpi,default] *) End matrix_PointedTopology. Section matrix_Complete. -Variables (T : completeType) (m n : nat). +Variables (d : fdisp_t) (T : completeType d) (m n : nat). Lemma mx_complete (F : set_system 'M[T]_(m, n)) : ProperFilter F -> cauchy F -> cvg F. @@ -183,13 +186,13 @@ move: (i) (j); near: M'; near: M; apply: nearP_dep; apply: Fc. by exists (fun _ _ => (split_ent A)^-1%relation) => ?? //; apply: entourage_inv. Unshelve. all: by end_near. Qed. -HB.instance Definition _ := Uniform_isComplete.Build 'M[T]_(m, n) mx_complete. +HB.instance Definition _ := Uniform_isComplete.Build _ 'M[T]_(m, n) mx_complete. End matrix_Complete. (**md Matrices: *) Section matrix_PseudoMetric. -Variables (m n : nat) (R : numDomainType) (T : pseudoMetricType R). +Context d (m n : nat) (R : numDomainType) (T : pseudoMetricType d R). Implicit Types (x y : 'M[T]_(m, n)) (e : R). Definition mx_ball x e y := 0 < e /\ forall i j, ball (x i j) e (y i j). @@ -225,9 +228,11 @@ apply: le_trans (@bigmin_le _ {posnum R} _ _ i _) _. exact: bigmin_le. Qed. -HB.instance Definition _ := Uniform_isPseudoMetric.Build R 'M[T]_(m, n) +HB.instance Definition _ := Uniform_isPseudoMetric.Build + _ R 'M[T]_(m, n) mx_ball_center mx_ball_sym mx_ball_triangle mx_entourage. End matrix_PseudoMetric. -HB.instance Definition _ (R : numFieldType) (T : completePseudoMetricType R) - (m n : nat) := Uniform_isComplete.Build 'M[T]_(m, n) cauchy_cvg. +HB.instance Definition _ d (R : numFieldType) + (T : completePseudoMetricType d R) (m n : nat) := + Uniform_isComplete.Build _ 'M[T]_(m, n) cauchy_cvg. diff --git a/theories/topology_theory/metric_structure.v b/theories/topology_theory/metric_structure.v index 06f4b1a94e..ce214dee1a 100644 --- a/theories/topology_theory/metric_structure.v +++ b/theories/topology_theory/metric_structure.v @@ -21,6 +21,8 @@ From mathcomp Require Import topology_structure uniform_structure (* ``` *) (******************************************************************************) +Reserved Notation "d .-mdist" (at level 4, format "d .-mdist"). + Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. @@ -31,7 +33,8 @@ Import numFieldTopology.Exports. Local Open Scope classical_set_scope. Local Open Scope ring_scope. -HB.mixin Record PseudoMetric_isMetric (K : numDomainType) M & PseudoMetric K M := { +HB.mixin Record PseudoMetric_isMetric d (K : numDomainType) M + & PseudoMetric d K M := { mdist : M -> M -> K ; mdist_ge0 : forall x y, 0 <= mdist x y ; mdist_positivity : forall x y, mdist x y = 0 -> x = y; @@ -39,13 +42,21 @@ HB.mixin Record PseudoMetric_isMetric (K : numDomainType) M & PseudoMetric K M : }. #[short(type="metricType")] -HB.structure Definition Metric (K : numDomainType) := - { M of PseudoMetric K M & PseudoMetric_isMetric K M }. +HB.structure Definition Metric d (K : numDomainType) := + { M of PseudoMetric d K M & PseudoMetric_isMetric d K M }. + +Module ExplicitNbhsDisplays. +Export separation_axioms.ExplicitNbhsDisplays. + +Notation "d .-mdist" := (@mdist d _ _) : fdisp_scope. +Notation "'mdist'" := (@mdist default_fdisp _ _) (only printing) : fdisp_scope. + +End ExplicitNbhsDisplays. Section metric_numDomainType. -Context {R : numDomainType} (T : metricType R). +Context {d} {R : numDomainType} (T : metricType d R). -Let dist := @mdist R T. +Let dist := @mdist d R T. Lemma metric_sym x y : dist x y = dist y x. Proof. @@ -53,11 +64,11 @@ have cxy : dist x y >=< dist y x. by apply: real_comparable; apply: ger0_real; exact: mdist_ge0. apply/eqP; rewrite eq_le; apply/andP; split. - rewrite comparable_leNgt//; apply/negP => xy. - have := @ball_sym _ _ y x (dist x y); rewrite !ballEmdist/= => /(_ xy). + have := @ball_sym _ _ _ y x (dist x y); rewrite !ballEmdist/= => /(_ xy). by rewrite ltxx. - rewrite comparable_leNgt//; first by rewrite comparable_sym. apply/negP => xy. - have := @ball_sym _ _ x y (dist y x); rewrite !ballEmdist/= => /(_ xy). + have := @ball_sym _ _ _ x y (dist y x); rewrite !ballEmdist/= => /(_ xy). by rewrite ltxx. Qed. @@ -78,9 +89,9 @@ Qed. End metric_numDomainType. Section metric_numFieldType. -Context {R : numFieldType} (T : metricType R). +Context {d} {R : numFieldType} (T : metricType d R). -Let dist := @mdist R T. +Let dist := @mdist d R T. Lemma metric_triangle x y z : dist x z <= dist x y + dist y z. Proof. @@ -110,7 +121,7 @@ Qed. End metric_numFieldType. Section prod_metric. -Context {K : numDomainType} (T U : metricType K). +Context {d d'} {K : numDomainType} (T : metricType d K) (U : metricType d' K). Let M := (T * U)%type. @@ -133,7 +144,7 @@ rewrite (surjective_pairing x) (surjective_pairing y). by congr pair; exact: mdist_positivity. Qed. -Let ballEprod_mdist x d : ball x d = [set y | prod_mdist x y < d]. +Let ballEprod_mdist x e : ball x e = [set y | prod_mdist x y < e]. Proof. apply/seteqP; split => [y []|y /= xyd]. rewrite !ballEmdist/= /prod_mdist => b1 b2. @@ -142,12 +153,13 @@ rewrite /ball/= /prod_ball/= !ballEmdist/=. by apply/andP; rewrite -comparable_gt_max. Qed. -HB.instance Definition _ := PseudoMetric_isMetric.Build K (T * U)%type +HB.instance Definition _ := PseudoMetric_isMetric.Build _ K (T * U)%type prod_mdist_ge0 prod_mdist_positivity ballEprod_mdist. End prod_metric. -HB.factory Record isMetric (K : numFieldType) (M : Type) & Choice M := { +HB.factory Record isMetric (d : fdisp_t) (K : numFieldType) (M : Type) + & Choice M := { mdist : M -> M -> K ; mdistxx : forall x, mdist x x = 0 ; mdist_positivity : forall x y, mdist x y = 0 -> x = y ; @@ -155,7 +167,7 @@ HB.factory Record isMetric (K : numFieldType) (M : Type) & Choice M := { mdist_triangle : forall y x z, mdist x z <= mdist x y + mdist y z }. -HB.builders Context K M & isMetric K M. +HB.builders Context d K M & isMetric d K M. Let ball (x : M) e : set M := [set y | mdist x y < e]. @@ -165,7 +177,7 @@ Let nbhs (x : M) : set_system M := nbhs_ ent x. Let nbhsE : nbhs = nbhs_ ent. Proof. by []. Qed. -HB.instance Definition _ := hasNbhs.Build M nbhs. +HB.instance Definition _ := hasNbhs.Build d M nbhs. Let ball_center x (e : K) : 0 < e -> ball x e x. Proof. by move=> e0; rewrite /ball/= mdistxx. Qed. @@ -181,7 +193,7 @@ Qed. Let entourageE : ent = entourage_ ball. Proof. by []. Qed. -HB.instance Definition _ := @Nbhs_isPseudoMetric.Build K M +HB.instance Definition _ := @Nbhs_isPseudoMetric.Build _ K M ent nbhsE ball ball_center ball_sym ball_triangle entourageE. Let mdist_ge0 x y : 0 <= mdist x y. @@ -190,9 +202,9 @@ rewrite -(@pmulrn_lge0 _ _ 2)// -(mdistxx x). by rewrite (le_trans (mdist_triangle y _ _))// mdist_sym -mulr2n. Qed. -Let ballEmdist x d : ball x d = [set y | mdist x y < d]. Proof. by []. Qed. +Let ballEmdist x e : ball x e = [set y | mdist x y < e]. Proof. by []. Qed. -HB.instance Definition _ := PseudoMetric_isMetric.Build K M +HB.instance Definition _ := PseudoMetric_isMetric.Build _ K M mdist_ge0 mdist_positivity ballEmdist. HB.end. @@ -213,7 +225,7 @@ Let ballEmdist x d : ball x d = [set y | dist x y < d]. Proof. by apply/seteqP; split => [|]/= A; rewrite /ball/= distrC. Qed. HB.instance Definition _ := - @PseudoMetric_isMetric.Build R R^o dist dist_ge0 dist_positivity ballEmdist. + @PseudoMetric_isMetric.Build _ R R^o dist dist_ge0 dist_positivity ballEmdist. End numFieldType_metric. @@ -224,12 +236,12 @@ from pseudoMetricNormedZmod to metricType *) Section metricType_numDomainType. -Context {K : numDomainType} {V : metricType K}. +Context {d} {K : numDomainType} {V : metricType d K}. Local Notation ball_mdist := (fun x d => [set y : V | mdist x y < d]). Lemma ball_mdistE : ball_mdist = ball. -Proof. by apply/funext => x; apply/funext=> d; rewrite - ballEmdist. Qed. +Proof. by apply/funext => ?; apply/funext=> ?; rewrite -ballEmdist. Qed. Local Notation nbhs_mdist := (nbhs_ball_ ball_mdist). @@ -283,7 +295,7 @@ from pseudoMetricNormedZmodType to metricType *) -Variables (R : numFieldType) (V : metricType R). +Context d (R : numFieldType) (V : metricType d R). Lemma nbhsr0P (P : set V) x : (\forall y \near x, P y) <-> @@ -292,14 +304,14 @@ Proof. rewrite near_withinE. split. move => /nbhs_mdistP[/= _/posnumP[e] /(_ _) Px]. - apply/(@nbhs_mdistP R R^o). + apply/(@nbhs_mdistP _ R R^o). exists e%:num => //= r /= re yr y xyr. apply: Px => /=. rewrite (le_lt_trans _ re)//. rewrite (le_trans xyr)//. by rewrite /mdist/= subr0 real_ler_norm// gtr0_real. -move => /(@nbhs_mdistP R R^o)[/= _/posnumP[e] /(_ _) Px]. -apply/(@nbhs_mdistP R V). +move => /(@nbhs_mdistP _ R R^o)[/= _/posnumP[e] /(_ _) Px]. +apply/(@nbhs_mdistP _ R V). exists (e%:num / 2) => //= r /= re; apply: (Px (e%:num / 2)) => //=. by rewrite /mdist/= subr0 gtr0_norm// ltr_pdivrMr// ltr_pMr// ltr1n. by rewrite ltW. @@ -313,12 +325,12 @@ Let cvgrP {F : set_system V} {FF : Filter F} (y : V) : [<-> Proof. tfae; first by move=> *; apply: cvgr_dist_le. - by move=> Fy; near do apply: Fy; apply: nbhs_right_gt. -- move=> Fy; near=> e; near (0:R)^'+ => d; near=> x. - rewrite (@le_lt_trans _ _ d)//; first by near: x; near: d. - by near: d; apply: nbhs_right_lt; near: e; apply: nbhs_right_gt. -- move=> Fy; apply/cvgrPdist_lt => e e_gt0; near (0:R)^'+ => d. - near=> x; rewrite (@lt_le_trans _ _ d)//; first by near: x; near: d. - by near: d; apply: nbhs_right_le. +- move=> Fy; near=> e; near (0:R)^'+ => e'; near=> x. + rewrite (@le_lt_trans _ _ e')//; first by near: x; near: e'. + by near: e'; apply: nbhs_right_lt; near: e; apply: nbhs_right_gt. +- move=> Fy; apply/cvgrPdist_lt => e e_gt0; near (0:R)^'+ => e'. + near=> x; rewrite (@lt_le_trans _ _ e')//; first by near: x; near: e'. + by near: e'; apply: nbhs_right_le. Unshelve. all: by end_near. Qed. Lemma cvgrPdist_le {T} {F : set_system T} {FF : Filter F} (f : T -> V) (y : V) : @@ -368,7 +380,7 @@ Lemma real_cvgr_gt {T} {F : set_system T} {FF : Filter F} (f : T -> R) (y : R) : Proof. move=> yr Fy z zy; near=> x => fxr. rewrite -ltrN2 -(ltrD2l y) real_ltr_normlW// ?rpredB// distrC. -by near: x; apply: (@metricType_numDomainType.cvgr_dist_lt _ R^o) => //; rewrite subr_gt0. +by near: x; apply: (@metricType_numDomainType.cvgr_dist_lt _ _ R^o) => //; rewrite subr_gt0. Unshelve. all: by end_near. Qed. Lemma real_cvgr_ge {T} {F : set_system T} {FF : Filter F} (f : T -> R) (y : R) : @@ -393,14 +405,14 @@ Lemma cvgr_lt f (y : R) : f @ F --> y -> forall z, z > y -> \forall t \near F, f t < z. Proof. move=> Fy z zy; near=> x; rewrite -(ltrD2r (- y)) ltr_normlW//. -by near: x; apply: (@metricType_numDomainType.cvgr_dist_lt _ R^o) => //; rewrite subr_gt0. +by near: x; apply: (@metricType_numDomainType.cvgr_dist_lt _ _ R^o) => //; rewrite subr_gt0. Unshelve. all: by end_near. Qed. Lemma cvgr_gt f (y : R) : f @ F --> y -> forall z, y > z -> \forall t \near F, f t > z. Proof. move=> Fy z zy; near=> x; rewrite -ltrN2 -(ltrD2l y) ltr_normlW// distrC. -by near: x; apply: (@metricType_numDomainType.cvgr_dist_lt _ R^o) => //; rewrite subr_gt0. +by near: x; apply: (@metricType_numDomainType.cvgr_dist_lt _ _ R^o) => //; rewrite subr_gt0. Unshelve. all: by end_near. Qed. Lemma cvgr_le f (y : R) : @@ -419,7 +431,7 @@ Lemma squeeze_cvgr f g h : (\forall x \near F, f x <= g x <= h x) -> forall l : R, f @ F --> l -> h @ F --> l -> g @ F --> l. Proof. move=> fgh l lfa lga. -apply/(@metricType_numDomainType.cvgrPdist_lt R R^o) => e e_gt0. +apply/(@metricType_numDomainType.cvgrPdist_lt _ R R^o) => e e_gt0. near=> x; have /(_ _)/andP[//|fg gh] := near fgh x. rewrite ltr_distl (lt_le_trans _ fg) ?(le_lt_trans gh)//=. by near: x; apply: (cvgr_gt lfa); rewrite // gtrDl oppr_lt0. diff --git a/theories/topology_theory/nat_topology.v b/theories/topology_theory/nat_topology.v index 9f2a95bf90..117d8ecc07 100644 --- a/theories/topology_theory/nat_topology.v +++ b/theories/topology_theory/nat_topology.v @@ -20,8 +20,9 @@ Import Order.TTheory GRing.Theory Num.Theory. Local Open Scope classical_set_scope. Local Open Scope ring_scope. -HB.instance Definition _ := hasNbhs.Build nat principal_filter. -HB.instance Definition _ := Discrete_ofNbhs.Build nat erefl. +HB.instance Definition _ := + hasNbhs.Build default_fdisp nat principal_filter. +HB.instance Definition _ := Discrete_ofNbhs.Build _ nat erefl. Local Lemma nat_nbhs_itv (n : nat) : nbhs n = filter_from @@ -39,10 +40,10 @@ move=> r /=; rewrite in_itv /= => nr2; suff: r = n.+1 by move=> ->. exact/esym/le_anti. Qed. -HB.instance Definition _ := Order_isNbhs.Build _ nat nat_nbhs_itv. -HB.instance Definition _ := DiscreteUniform_ofNbhs.Build nat. +HB.instance Definition _ := Order_isNbhs.Build _ _ nat nat_nbhs_itv. +HB.instance Definition _ := DiscreteUniform_ofNbhs.Build _ nat. HB.instance Definition _ {R : numDomainType} := - @DiscretePseudoMetric_ofUniform.Build R nat. + @DiscretePseudoMetric_ofUniform.Build _ R nat. Lemma nbhs_infty_gt N : \forall n \near \oo, (N < n)%N. Proof. by exists N.+1. Qed. diff --git a/theories/topology_theory/num_topology.v b/theories/topology_theory/num_topology.v index c219d00f9f..532e13850b 100644 --- a/theories/topology_theory/num_topology.v +++ b/theories/topology_theory/num_topology.v @@ -27,8 +27,8 @@ Unset Printing Implicit Defensive. Local Open Scope classical_set_scope. Local Open Scope ring_scope. -HB.instance Definition _ (R : numDomainType) := hasNbhs.Build R^o - (nbhs_ball_ (ball_ (fun x => `|x|))). +HB.instance Definition _ (R : numDomainType) := hasNbhs.Build + default_fdisp R^o (nbhs_ball_ (ball_ (fun x => `|x|))). Module TopologicalNumDomainType. Section TopologicalNumDomainType. @@ -74,16 +74,17 @@ End TopologicalNumDomainType. End TopologicalNumDomainType. -HB.instance Definition _ (R : numDomainType) := Nbhs_isNbhsTopological.Build R^o +HB.instance Definition _ (R : numDomainType) := Nbhs_isNbhsTopological.Build + _ R^o (@TopologicalNumDomainType.nbhs_filter R) (@TopologicalNumDomainType.nbhs_singleton R) (@TopologicalNumDomainType.nbhs_nbhs R). -HB.instance Definition _ (R : numFieldType) := Nbhs_isPseudoMetric.Build R R^o +HB.instance Definition _ (R : numFieldType) := Nbhs_isPseudoMetric.Build _ R R^o nbhs_ball_normE ball_norm_center ball_norm_symmetric ball_norm_triangle erefl. HB.instance Definition _ (R : numFieldType) := - Uniform_isPseudoMetric.Build R R^o + Uniform_isPseudoMetric.Build _ R R^o ball_norm_center ball_norm_symmetric ball_norm_triangle erefl. Lemma real_order_nbhsE (R : realFieldType) (x : R^o) : nbhs x = @@ -139,11 +140,11 @@ HB.instance Definition _ (R : numFieldType) := PseudoPointedMetric.copy R R^o. #[export, non_forgetful_inheritance] HB.instance Definition _ (R : realFieldType) := - Order_isNbhs.Build _ R (@real_order_nbhsE R). + Order_isNbhs.Build _ _ R (@real_order_nbhsE R). #[export, non_forgetful_inheritance] HB.instance Definition _ (R : realType) := - Order_isNbhs.Build _ R (@real_order_nbhsE R). + Order_isNbhs.Build _ _ R (@real_order_nbhsE R). Module Exports. HB.reexport. End Exports. @@ -157,8 +158,8 @@ rewrite predeqE => A; split=> //= -[] e e_gt0 xeA; exists e => //= y /=. by rewrite -opprD normrN => ?; rewrite -[y]opprK; apply: xeA; rewrite /= opprK. Qed. -Lemma cvg_compNP {T : topologicalType} {R : numFieldType} (f : R -> T) (a : R) - (l : T) : +Lemma cvg_compNP {d} {T : topologicalType d} {R : numFieldType} + (f : R -> T) (a : R) (l : T) : (f \o -%R) x @[x --> a] --> l <-> f x @[x --> (- a)] --> l. Proof. by rewrite nbhsN. Qed. @@ -236,13 +237,14 @@ apply; last by rewrite gtrBl. by rewrite /= opprB addrC subrK ger0_norm// gtr_pMr// invf_lt1// ltr1n. Qed. -Lemma cvg_dnbhs_at_right (T : topologicalType) (f : R -> T) (p : R) (l : T) : +Lemma cvg_dnbhs_at_right d (T : topologicalType d) + (f : R -> T) (p : R) (l : T) : f x @[x --> p^'] --> l -> f x @[x --> p^'+] --> l. Proof. by apply: cvg_trans; apply: cvg_app; apply: within_subset=> r ?; rewrite gt_eqF. Qed. -Lemma cvg_dnbhs_at_left (T : topologicalType) (f : R -> T) (p : R) (l : T) : +Lemma cvg_dnbhs_at_left d (T : topologicalType d) (f : R -> T) (p : R) (l : T) : f x @[x --> p^'] --> l -> f x @[x --> p^'-] --> l. Proof. by apply: cvg_trans; apply: cvg_app; apply: within_subset=> r ?; rewrite lt_eqF. @@ -340,7 +342,7 @@ Lemma at_right_shift (T : Type) x a (f : R -> T) : (f @ (x + a)^'+) = (f (y + a) @[y --> x^'+]). Proof. by rewrite at_rightD. Qed. -Context {V : topologicalType} (f : R -> V) (x : R). +Context {d} {V : topologicalType d} (f : R -> V) (x : R). Lemma cvg_at_right_filter (l : V) : f z @[z --> x] --> l -> f z @[z --> x^'+] --> l. @@ -375,7 +377,7 @@ Notation "x ^'+" := (at_right x) : classical_set_scope. #[global] Hint Extern 0 (Filter (nbhs _^'-)) => (apply: at_left_proper_filter) : typeclass_instances. -Lemma cvg_at_right_left_dnbhs (R : realFieldType) (T : topologicalType) +Lemma cvg_at_right_left_dnbhs d (R : realFieldType) (T : topologicalType d) (f : R -> T) (p : R) (l : T) : f x @[x --> p^'+] --> l -> f x @[x --> p^'-] --> l -> f x @[x --> p^'] --> l. Proof. @@ -385,7 +387,7 @@ apply: filter_app lf; apply: filter_app rf. by near=> t => xlt xgt /lt_total/orP[|]. Unshelve. all: by end_near. Qed. -Lemma left_right_continuousP {R : realFieldType} {T : topologicalType} +Lemma left_right_continuousP {d} {R : realFieldType} {T : topologicalType d} (f : R -> T) x : f @ x^'- --> f x /\ f @ x^'+ --> f x <-> f @ x --> f x. Proof. @@ -447,7 +449,7 @@ have : inf X <= inf X - f%:num by exact: ge_inf. by apply/negP; rewrite -ltNge; rewrite ltrBlDr ltrDl. Qed. -Lemma in_continuous_mksetP {T : realFieldType} {U : nbhsType} +Lemma in_continuous_mksetP {d} {T : realFieldType} {U : nbhsType d} (i : interval T) (f : T -> U) : {in i, continuous f} <-> {in [set` i], continuous f}. Proof. @@ -555,7 +557,7 @@ Lemma lt_le_nbhsr {R : realFieldType} (t x : R) : t < x -> \forall y \near nbhs x, t <= y. Proof. by move/lt_nbhsr; apply: filterS => y /ltW. Qed. -Lemma not_nearP {T : topologicalType} (p : T) (P : set T) : +Lemma not_nearP {d} {T : topologicalType d} (p : T) (P : set T) : ~ (\forall x \near p, P x) <-> forall V : set T, nbhs p V -> exists2 x, V x & ~ P x. Proof. @@ -564,7 +566,7 @@ split. - by move=> /(_ P) /[apply] => -[]. Unshelve. all: by end_near. Qed. -Lemma not_nearPball {R : numDomainType} {M : pseudoMetricType R} +Lemma not_nearPball {d} {R : numDomainType} {M : pseudoMetricType d R} (p : M) (P : set M) : ~ (\forall x \near p, P x) <-> forall (e : {posnum R}), exists2 x, ball p e%:num x & ~ P x. @@ -648,7 +650,7 @@ Import unstable.EndlessDense. Section theory. Local Open Scope order_scope. Local Open Scope classical_set_scope. -Context {d} {T : orderTopologicalType d}. +Context {td od} {T : orderTopologicalType td od}. Implicit Types (x y : T) (i : interval T). Lemma open_itv_open_ends i : is_endless T -> is_dense T -> neitv i -> diff --git a/theories/topology_theory/one_point_compactification.v b/theories/topology_theory/one_point_compactification.v index f6cd875af6..245ef43d54 100644 --- a/theories/topology_theory/one_point_compactification.v +++ b/theories/topology_theory/one_point_compactification.v @@ -20,8 +20,13 @@ Local Open Scope ring_scope. Definition one_point_compactification (X : Type) : Type := option X. +Fact opc_fdisp : fdisp_t. +Proof. by []. Qed. + +Notation "'opc'" := (opc_fdisp) (only printing) : fdisp_scope. + Section one_point_compactification. -Context {X : topologicalType}. +Context {d} {X : topologicalType d}. Local Notation opc := (one_point_compactification X). @@ -59,9 +64,10 @@ exists (~` C); first by split => //; exact: closed_openC. by move=> z /= nCz; apply: nCA; left. Qed. -HB.instance Definition _ := hasNbhs.Build opc one_point_nbhs. +HB.instance Definition _ := + hasNbhs.Build opc_fdisp opc one_point_nbhs. -HB.instance Definition _ := @Nbhs_isNbhsTopological.Build opc +HB.instance Definition _ := @Nbhs_isNbhsTopological.Build _ opc one_point_filter one_point_singleton one_point_nbhs_nbhs. Lemma one_point_compactification_compact : compact [set: opc]. @@ -81,21 +87,21 @@ near=> j => z _; case: z => [z|]. Unshelve. all: by end_near. Qed. Lemma one_point_compactification_some_nbhs (x : X) (U : set X) : - nbhs x U -> @nbhs _ opc (Some x) (Some @` U). + nbhs x U -> @nbhs _ _ opc (Some x) (Some @` U). Proof. exact/filterS/preimage_image. Qed. Lemma one_point_compactification_some_continuous : continuous (Some : X -> opc). Proof. by move=> x U. Qed. Lemma one_point_compactification_open_some (U : set X) : - open U -> @open opc (Some @` U). + open U -> @open _ opc (Some @` U). Proof. rewrite !openE/= => UU' opcX [x /UU' Ux <-]. exact/one_point_compactification_some_nbhs. Qed. Lemma one_point_compactification_initial_topology : - @nbhs _ (@initial_topology X opc Some) = @nbhs _ X. + @nbhs _ _ (@initial_topology X opc Some) = @nbhs _ _ X. Proof. rewrite predeq2E => x U; split; rewrite /(@nbhs _ (initial_topology _))/=. case=> _ [[/= W] oW <- /= WSs] /filterS; apply. diff --git a/theories/topology_theory/order_topology.v b/theories/topology_theory/order_topology.v index fd27586d3b..18610763f3 100644 --- a/theories/topology_theory/order_topology.v +++ b/theories/topology_theory/order_topology.v @@ -30,23 +30,23 @@ Unset Printing Implicit Defensive. Local Open Scope classical_set_scope. Local Open Scope ring_scope. -HB.structure Definition POrderedNbhs d := - { T of Nbhs T & Order.isPOrder d T }. +HB.structure Definition POrderedNbhs td od := + { T of Nbhs td T & Order.isPOrder od T }. -HB.structure Definition POrderedTopological d := - { T of Topological T & Order.isPOrder d T }. +HB.structure Definition POrderedTopological td od := + { T of Topological td T & Order.isPOrder od T }. -HB.structure Definition POrderedUniform d := - {T of Uniform T & Order.isPOrder d T}. +HB.structure Definition POrderedUniform td od := + {T of Uniform td T & Order.isPOrder od T}. -HB.structure Definition POrderedPseudoMetric d (R : numDomainType) := - {T of PseudoMetric R T & Order.isPOrder d T}. +HB.structure Definition POrderedPseudoMetric td od (R : numDomainType) := + {T of PseudoMetric td R T & Order.isPOrder od T}. -HB.structure Definition POrderedPointedTopological d := - {T of PointedTopological T & Order.isPOrder d T}. +HB.structure Definition POrderedPointedTopological td od := + {T of PointedTopological td T & Order.isPOrder od T}. (** TODO: generalize this to a preOrder once that's available *) -HB.mixin Record Order_isNbhs d (T : Type) & Nbhs T & Order.Total d T := { +HB.mixin Record Order_isNbhs td od (T : Type) & Nbhs td T & Order.Total od T := { (** Note that just the intervals `]a, b[ doesn't work when the order has a top or bottom element, so we also need the rays `]-oo, b[ and ]a, +oo[ *) itv_nbhsE : forall x : T, nbhs x = filter_from @@ -55,42 +55,42 @@ HB.mixin Record Order_isNbhs d (T : Type) & Nbhs T & Order.Total d T := { }. #[short(type="orderNbhsType")] -HB.structure Definition OrderNbhs d := - { T of Nbhs T & Order.Total d T & Order_isNbhs d T }. +HB.structure Definition OrderNbhs td od := + { T of Nbhs td T & Order.Total od T & Order_isNbhs td od T }. #[short(type="orderTopologicalType")] -HB.structure Definition OrderTopological d := - { T of Topological T & Order.Total d T & Order_isNbhs d T }. +HB.structure Definition OrderTopological td od := + { T of Topological td T & Order.Total od T & Order_isNbhs td od T }. #[short(type="orderUniformType")] -HB.structure Definition OrderUniform d := - {T of Uniform T & OrderTopological d T}. +HB.structure Definition OrderUniform td od := + {T of Uniform td T & OrderTopological td od T}. #[short(type="orderPseudoMetricType")] -HB.structure Definition OrderPseudoMetric d (R : numDomainType) := - {T of PseudoMetric R T & OrderTopological d T}. +HB.structure Definition OrderPseudoMetric td od (R : numDomainType) := + {T of PseudoMetric td R T & OrderTopological td od T}. Section order_topologies. Local Open Scope order_scope. Local Open Scope classical_set_scope. -Context {d} {T : orderTopologicalType d}. +Context {td od} {T : orderTopologicalType td od}. Implicit Types x y : T. -Lemma rray_open x : @open T `]x, +oo[. +Lemma rray_open x : @open _ T `]x, +oo[. Proof. rewrite openE /interior => z xoz; rewrite itv_nbhsE. by exists `]x, +oo[%O => //; split => //; left. Qed. Hint Resolve rray_open : core. -Lemma lray_open x : @open T `]-oo, x[. +Lemma lray_open x : @open _ T `]-oo, x[. Proof. rewrite openE /interior => z xoz; rewrite itv_nbhsE. by exists (`]-oo, x[)%O => //; split => //; left. Qed. Hint Resolve lray_open : core. -Lemma itv_open x y : @open T `]x, y[. +Lemma itv_open x y : @open _ T `]x, y[. Proof. by rewrite set_itv_splitI /=; apply: openI. Qed. Hint Resolve itv_open : core. @@ -100,15 +100,15 @@ case: i; rewrite /itv_open_ends => [[[]t1|[]]] [[]t2|[]]// ?. by rewrite set_itvE; exact: openT. Qed. -Lemma rray_closed x : @closed T `[x, +oo[. +Lemma rray_closed x : @closed _ T `[x, +oo[. Proof. by rewrite -setCitvl closedC. Qed. Hint Resolve rray_closed : core. -Lemma lray_closed x : @closed T `]-oo, x]. +Lemma lray_closed x : @closed _ T `]-oo, x]. Proof. by rewrite -setCitvr closedC. Qed. Hint Resolve lray_closed : core. -Lemma itv_closed x y : @closed T `[x, y]. +Lemma itv_closed x y : @closed _ T `[x, y]. Proof. by rewrite set_itv_splitI; apply: closedI => /=. Qed. Hint Resolve itv_closed : core. @@ -197,17 +197,23 @@ Hint Resolve itv_closed : core. Definition order_topology (T : Type) : Type := T. +Fact order_fdisp (od : Order.disp_t) : fdisp_t. +Proof. by []. Qed. + +Notation "od .-order" := (order_fdisp od) (format "od .-order") : fdisp_scope. +Notation "'order'" := (order_fdisp (Order.Disp _ _)) : fdisp_scope. + Section induced_order_topology. -Context {d} {T : orderType d}. +Context {od} {T : orderType od}. Local Notation oT := (order_topology T). HB.instance Definition _ := isPointed.Build (interval T) (`]-oo,+oo[). HB.instance Definition _ := Order.Total.on oT. -HB.instance Definition _ := @isSubBaseTopological.Build oT - (interval T) (itv_is_open_unbounded) (fun i => [set` i]). +HB.instance Definition _ := @isSubBaseTopological.Build + (order_fdisp od) oT (interval T) (itv_is_open_unbounded) (fun i => [set` i]). Lemma order_nbhs_itv (x : oT) : nbhs x = filter_from (fun i => itv_open_ends i /\ x \in i) @@ -245,10 +251,10 @@ exists j; first split. by move=> ? ? ? ? <- <-; rewrite itv_setI. Qed. -HB.instance Definition _ := Order_isNbhs.Build _ oT order_nbhs_itv. +HB.instance Definition _ := Order_isNbhs.Build _ _ oT order_nbhs_itv. End induced_order_topology. -Lemma min_continuous {d} {T : orderTopologicalType d} : +Lemma min_continuous {td od} {T : orderTopologicalType td od} : continuous (fun xy : T * T => Order.min xy.1 xy.2). Proof. case=> x y; have [<- U /=|]:= eqVneq x y. @@ -279,15 +285,16 @@ rewrite min_l// leNgt; apply: contra_notN (xNy b) => ba. by rewrite xb (lt_trans ba). Qed. -Lemma min_fun_continuous {d} {X : topologicalType} {T : orderTopologicalType d} - (f g : X -> T) : +Lemma min_fun_continuous {td od} + {X : topologicalType td} {T : orderTopologicalType td od} + (f g : X -> T) : continuous f -> continuous g -> continuous (f \min g). Proof. move=> fc gc z; apply: continuous2_cvg; [|exact: fc|exact: gc]. by apply min_continuous. Qed. -Lemma max_continuous {d} {T : orderTopologicalType d} : +Lemma max_continuous {td od} {T : orderTopologicalType td od} : continuous (fun xy : T * T => Order.max xy.1 xy.2). Proof. case=> x y; have [<- U|] := eqVneq x y. @@ -318,8 +325,9 @@ rewrite max_r// leNgt; apply: contra_notN (xNy b) => ba. by rewrite xb (lt_trans ba). Qed. -Lemma max_fun_continuous {d} {X : topologicalType} {T : orderTopologicalType d} - (f g : X -> T): +Lemma max_fun_continuous {td od} + {X : topologicalType td} {T : orderTopologicalType td od} + (f g : X -> T) : continuous f -> continuous g -> continuous (f \max g). Proof. move=> fc gc z; apply: continuous2_cvg; [|exact: fc|exact: gc]. diff --git a/theories/topology_theory/product_topology.v b/theories/topology_theory/product_topology.v index 85246636b7..ff154e4ee7 100644 --- a/theories/topology_theory/product_topology.v +++ b/theories/topology_theory/product_topology.v @@ -26,7 +26,7 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section Prod_Topology. -Context {T U : topologicalType}. +Context {d1 d2} {T : topologicalType d1} {U : topologicalType d2}. Let prod_nbhs (p : T * U) := filter_prod (nbhs p.1) (nbhs p.2). @@ -48,12 +48,13 @@ Qed. (*HB.instance Definition _ := hasNbhs.Build (T * U)%type prod_nbhs.*) (* generates: Warning: HB: no new instance is generated [HB.no-new-instance,HB,elpi,default] *) -HB.instance Definition _ := Nbhs_isNbhsTopological.Build (T * U)%type +HB.instance Definition _ := Nbhs_isNbhsTopological.Build _ (T * U)%type prod_nbhs_filter prod_nbhs_singleton prod_nbhs_nbhs. End Prod_Topology. -Lemma fst_open {U V : topologicalType} (A : set (U * V)) : +Lemma fst_open {d1 d2} {U : topologicalType d1} {V : topologicalType d2} + (A : set (U * V)) : open A -> open (fst @` A). Proof. rewrite !openE => oA z [[a b/=] Aab <-]; rewrite /interior. @@ -61,7 +62,8 @@ have [[P Q] [Pa Qb] pqA] := oA _ Aab; apply: (@filterS _ _ _ P) => // p Pp. by exists (p, b) => //=; apply: pqA; split=> //=; exact: nbhs_singleton. Qed. -Lemma snd_open {U V : topologicalType} (A : set (U * V)) : +Lemma snd_open {d1 d2} {U : topologicalType d1} {V : topologicalType d2} + (A : set (U * V)) : open A -> open (snd @` A). Proof. rewrite !openE => oA z [[a b/=] Aab <-]; rewrite /interior. @@ -72,12 +74,12 @@ Qed. (** product of two uniform spaces *) Section prod_Uniform. Local Open Scope relation_scope. -Context {U V : uniformType}. +Context {d1 d2} {U : uniformType d1} {V : uniformType d2}. Implicit Types A : set ((U * V) * (U * V)). Definition prod_ent := [set A : set ((U * V) * (U * V)) | - filter_prod (@entourage U) (@entourage V) + filter_prod (@entourage _ U) (@entourage _ V) [set ((xy.1.1,xy.2.1),(xy.1.2,xy.2.2)) | xy in A]]. Lemma prod_entP (A : set (U * U)) (B : set (V * V)) : @@ -90,7 +92,8 @@ Qed. Lemma prod_ent_filter : Filter prod_ent. Proof. -have prodF := filter_prod_filter (@entourage_filter U) (@entourage_filter V). +have prodF := filter_prod_filter + (@entourage_filter _ U) (@entourage_filter _ V). split; rewrite /prod_ent. - by rewrite -setXTT; apply: prod_entP filterT filterT. - move=> A B /= entA entB; apply: filterS (filterI entA entB) => xy []. @@ -148,12 +151,13 @@ move=> [zt Bzt /eqP]; rewrite !xpair_eqE andbACA -!xpair_eqE. by rewrite -!surjective_pairing => /eqP ztE; apply/xsectionP; rewrite -ztE. Qed. -HB.instance Definition _ := Nbhs_isUniform.Build (U * V)%type +HB.instance Definition _ := Nbhs_isUniform.Build _ (U * V)%type prod_ent_filter prod_ent_refl prod_ent_inv prod_ent_split prod_ent_nbhsE. End prod_Uniform. -Lemma entourage_prod_exS (U V : uniformType) (P : set ((U * V) * (U * V))) : +Lemma entourage_prod_exS d1 d2 (U : uniformType d1) (V : uniformType d2) + (P : set ((U * V) * (U * V))) : entourage P -> exists (A : set (U * U)) (B : set (V * V)), [/\ entourage A, entourage B & @@ -169,8 +173,8 @@ Qed. Definition interchange_prod {T U} (x : (T * U) * (T * U)) : (T * T) * (U * U) := (x.1.1, x.2.1, (x.1.2, x.2.2)). -Lemma entourage_interchange_prod {U V : uniformType} - (B : set (U * U)) (C : set (V * V)) : +Lemma entourage_interchange_prod {d1 d2} {U : uniformType d1} + {V : uniformType d2} (B : set (U * U)) (C : set (V * V)) : entourage B -> entourage C -> entourage (interchange_prod @^-1` (B `*` C)). Proof. move=> entB entC; exists (B, C) => //= -[[x1 x2] [x3 x4]] [/= HB HC]. @@ -178,7 +182,7 @@ by exists (x1, x3, (x2, x4)). Qed. Section unif_continuous_pair. -Context {U V W : uniformType}. +Context d1 d2 d3 {U : uniformType d1} {V : uniformType d2} {W : uniformType d3}. Lemma pair_unif_continuous (f : U -> V) (g : U -> W) : unif_continuous f -> unif_continuous g -> @@ -212,7 +216,8 @@ End unif_continuous_pair. (** product of two pseudoMetric spaces *) Section prod_PseudoMetric. -Context {R : numDomainType} {U V : pseudoMetricType R}. +Context {d1 d2} {R : numDomainType} + {U : pseudoMetricType d1 R} {V : pseudoMetricType d2 R}. Implicit Types (x y : U * V). Definition prod_ball x (eps : R) y := ball x.1 eps y.1 /\ ball x.2 eps y.2. @@ -247,13 +252,14 @@ suff /sABP [] : (A `*` B) ((a, c), (b, d)). by apply: le_ball bbd; rewrite num_le ge_min lexx orbT. Qed. -HB.instance Definition _ := Uniform_isPseudoMetric.Build R (U * V)%type +HB.instance Definition _ := Uniform_isPseudoMetric.Build _ R (U * V)%type prod_ball_center prod_ball_sym prod_ball_triangle prod_entourage. End prod_PseudoMetric. Section Nbhs_fct2. -Context {T : Type} {R : numDomainType} {U V : pseudoMetricType R}. +Context {d1 d2} {T : Type} {R : numDomainType} + {U : pseudoMetricType d1 R} {V : pseudoMetricType d2 R}. Lemma fcvg_ball2P {F : set_system U} {G : set_system V} {FF : Filter F} {FG : Filter G} (y : U) (z : V): (F, G) --> (y, z) <-> @@ -274,7 +280,8 @@ Qed. End Nbhs_fct2. -Lemma compact_setX {U V : topologicalType} (P : set U) (Q : set V) : +Lemma compact_setX {d1 d2} {U : topologicalType d1} {V : topologicalType d2} + (P : set U) (Q : set V) : compact P -> compact Q -> compact (P `*` Q). Proof. rewrite !compact_near_coveringP => cptP cptQ I F Pr Ff cvfPQ. @@ -288,14 +295,17 @@ case=> a [b i] /= [N2a [N1b]] Gi. by apply: (ngPr (b, a, i)); split => //; exact: N1N2N. Unshelve. all: by end_near. Qed. -Lemma swap_continuous {X Y : topologicalType} : continuous (@swap X Y). +Lemma swap_continuous {d1 d2} + {X : topologicalType d1} {Y : topologicalType d2} : + continuous (@swap X Y). Proof. case=> a b W /= [[U V]][] /= Ub Va UVW; exists (V, U); first by split. by case => //= ? ? [] ? ?; exact: UVW. Qed. Section reassociate_continuous. -Context {X Y Z : topologicalType}. +Context {d1 d2 d3} + {X : topologicalType d1} {Y : topologicalType d2} {Z : topologicalType d3}. Lemma prodA_continuous : continuous (@prodA X Y Z). Proof. diff --git a/theories/topology_theory/pseudometric_structure.v b/theories/topology_theory/pseudometric_structure.v index 9f51b893a4..0004d29421 100644 --- a/theories/topology_theory/pseudometric_structure.v +++ b/theories/topology_theory/pseudometric_structure.v @@ -51,6 +51,8 @@ From mathcomp Require Import uniform_structure. Import Order.TTheory GRing.Theory Num.Theory. +Reserved Notation "d .-ball" (at level 5, format "d .-ball"). + Unset SsrOldRewriteGoalsOrder. (* remove the line when requiring MathComp >= 2.6 *) Set Implicit Arguments. Unset Strict Implicit. @@ -71,7 +73,8 @@ Lemma entourage_E {R : numDomainType} {T T'} (ball : T -> R -> set T') : @filter_from R _ [set x | 0 < x] (fun e => [set xy | ball xy.1 e xy.2]). Proof. by []. Qed. -HB.mixin Record Uniform_isPseudoMetric (R : numDomainType) M & Uniform M := { +HB.mixin Record Uniform_isPseudoMetric d (R : numDomainType) M + & Uniform d M := { ball : M -> R -> M -> Prop ; ball_center_subproof : forall x (e : R), 0 < e -> ball x e x ; ball_sym_subproof : forall x y (e : R), ball x e y -> ball y e x ; @@ -81,15 +84,21 @@ HB.mixin Record Uniform_isPseudoMetric (R : numDomainType) M & Uniform M := { }. #[short(type="pseudoMetricType")] -HB.structure Definition PseudoMetric (R : numDomainType) := - {T of Uniform T & Uniform_isPseudoMetric R T}. +HB.structure Definition PseudoMetric d (R : numDomainType) := + {T of Uniform d T & Uniform_isPseudoMetric d R T}. #[short(type="pseudoPMetricType")] -HB.structure Definition PseudoPointedMetric (R : numDomainType) := - {T of Pointed T & Uniform T & Uniform_isPseudoMetric R T}. +HB.structure Definition PseudoPointedMetric d (R : numDomainType) := + {T of Pointed T & Uniform d T & Uniform_isPseudoMetric d R T}. + +HB.instance Definition _ (d d' : fdisp_t) R (T : pseudoMetricType d R) := + Uniform_isPseudoMetric.Build d' R (with_fdisp d' T) + ball_center_subproof ball_sym_subproof ball_triangle_subproof + entourageE_subproof. +HB.saturate with_fdisp. (* was uniformityOfBallMixin *) -HB.factory Record Nbhs_isPseudoMetric (R : numFieldType) M & Nbhs M := { +HB.factory Record Nbhs_isPseudoMetric d (R : numFieldType) M & Nbhs d M := { ent : set_system (M * M); nbhsE : nbhs = nbhs_ ent; ball : M -> R -> M -> Prop ; @@ -100,7 +109,7 @@ HB.factory Record Nbhs_isPseudoMetric (R : numFieldType) M & Nbhs M := { entourageE : ent = entourage_ ball }. -HB.builders Context R M & Nbhs_isPseudoMetric R M. +HB.builders Context d R M & Nbhs_isPseudoMetric d R M. Local Open Scope relation_scope. Let ball_le x : {homo ball x : e1 e2 / e1 <= e2 >-> e1 `<=` e2}. @@ -142,25 +151,25 @@ move=> xy [z xzhe zyhe]; apply: sbeA. by rewrite [e%:num]splitr; exact: ball_triangle zyhe. Qed. -HB.instance Definition _ := Nbhs_isUniform.Build M +HB.instance Definition _ := Nbhs_isUniform.Build d M entourage_filter_subproof ball_sym_subproof ball_triangle_subproof entourageE_subproof nbhsE. -HB.instance Definition _ := Uniform_isPseudoMetric.Build R M +HB.instance Definition _ := Uniform_isPseudoMetric.Build d R M ball_center ball_sym ball_triangle entourageE. HB.end. -Lemma entourage_ballE {R : numDomainType} {M : pseudoMetricType R} : - entourage_ (@ball R M) = entourage. +Lemma entourage_ballE d {R : numDomainType} {M : pseudoMetricType d R} : + entourage_ (@ball d R M) = entourage. Proof. by rewrite entourageE_subproof. Qed. -Lemma entourage_from_ballE {R : numDomainType} {M : pseudoMetricType R} : +Lemma entourage_from_ballE d {R : numDomainType} {M : pseudoMetricType d R} : @filter_from R _ [set x : R | 0 < x] - (fun e => [set xy | @ball R M xy.1 e xy.2]) = entourage. + (fun e => [set xy | @ball d R M xy.1 e xy.2]) = entourage. Proof. by rewrite -entourage_ballE. Qed. -Lemma entourage_ball {R : numDomainType} (M : pseudoMetricType R) +Lemma entourage_ball d {R : numDomainType} (M : pseudoMetricType d R) (e : {posnum R}) : entourage [set xy : M * M | ball xy.1 e%:num xy.2]. Proof. by rewrite -entourage_ballE; exists e%:num => /=. Qed. #[global] Hint Resolve entourage_ball : core. @@ -168,11 +177,14 @@ Proof. by rewrite -entourage_ballE; exists e%:num => /=. Qed. Definition nbhs_ball_ {R : numDomainType} {T T'} (ball : T -> R -> set T') (x : T) := @filter_from R _ [set e | e > 0] (ball x). -Definition nbhs_ball {R : numDomainType} {M : pseudoMetricType R} := - nbhs_ball_ (@ball R M). +Definition nbhs_ball d {R : numDomainType} {M : pseudoMetricType d R} := + nbhs_ball_ (@ball d R M). + +Notation "d .-nbhs_ball" := (@nbhs_ball d _ _) (format "d .-nbhs_ball"). +Notation "'nbhs_ball'" := (@nbhs_ball default_fdisp _ _) (only printing). -Lemma nbhs_ballE {R : numDomainType} {M : pseudoMetricType R} : - @nbhs_ball R M = nbhs. +Lemma nbhs_ballE d {R : numDomainType} {M : pseudoMetricType d R} : + @nbhs_ball d R M = nbhs. Proof. rewrite predeq2E => x P; rewrite -nbhs_entourageE; split. move=> [_/posnumP[e] sbxeP]; exists [set xy | ball xy.1 e%:num xy.2] => //. @@ -181,25 +193,25 @@ rewrite -entourage_ballE; move=> [A [e egt0 sbeA] sAP]. by exists e => // ? ?; exact/sAP/xsectionP/sbeA. Qed. -Lemma filter_from_ballE {R : numDomainType} {M : pseudoMetricType R} x : - @filter_from R _ [set x : R | 0 < x] (@ball R M x) = nbhs x. +Lemma filter_from_ballE d {R : numDomainType} {M : pseudoMetricType d R} x : + @filter_from R _ [set x : R | 0 < x] (@ball d R M x) = nbhs x. Proof. by rewrite -nbhs_ballE. Qed. Module Export NbhsBall. Definition nbhs_simpl := (nbhs_simpl,@filter_from_ballE,@nbhs_ballE). End NbhsBall. -Lemma nbhs_ballP {R : numDomainType} {M : pseudoMetricType R} (x : M) P : +Lemma nbhs_ballP d {R : numDomainType} {M : pseudoMetricType d R} (x : M) P : nbhs x P <-> nbhs_ball x P. Proof. by rewrite nbhs_simpl. Qed. -Lemma ball_center {R : numDomainType} (M : pseudoMetricType R) (x : M) +Lemma ball_center d {R : numDomainType} (M : pseudoMetricType d R) (x : M) (e : {posnum R}) : ball x e%:num x. Proof. exact: ball_center_subproof. Qed. #[global] Hint Extern 0 (ball _ _ _) => solve[apply: ball_center] : core. Section pseudoMetricType_numDomainType. -Context {R : numDomainType} {M : pseudoMetricType R}. +Context {d} {R : numDomainType} {M : pseudoMetricType d R}. Implicit Types x y z : M. Lemma ballxx x (e : R) : 0 < e -> ball x e x. @@ -276,18 +288,18 @@ End pseudoMetricType_numDomainType. #[global] Hint Resolve nbhsx_ballx : core. -Global Instance entourage_proper_filter {R : numDomainType} - {M : pseudoPMetricType R} : ProperFilter (@entourage M). +Global Instance entourage_proper_filter d {R : numDomainType} + {M : pseudoPMetricType d R} : ProperFilter (@entourage d M). Proof. apply: Build_ProperFilter_ex; rewrite -entourage_ballE => A [_/posnumP[e] sbeA]. by exists (point, point); apply: sbeA; apply: ballxx. Qed. -Arguments nbhsx_ballx {R M} x eps. -Arguments near_ball {R M} y eps. +Arguments nbhsx_ballx {d R M} x eps. +Arguments near_ball {d R M} y eps. Section pseudoMetricType_numFieldType. -Context {R : numFieldType} {M : pseudoMetricType R}. +Context {d} {R : numFieldType} {M : pseudoMetricType d R}. Implicit Types x y z p : M. Lemma ball_split z x y (e : R) : @@ -304,8 +316,8 @@ Proof. by move=> bxz /ball_sym /(ball_split bxz). Qed. End pseudoMetricType_numFieldType. -Lemma cvg_withinP {T : topologicalType} {R : archiRealFieldType} - {M : pseudoMetricType R} (f : M -> T) (p : M) (l : T) (A : set M) : +Lemma cvg_withinP {d} {T : topologicalType d} {R : archiRealFieldType} + {M : pseudoMetricType d R} (f : M -> T) (p : M) (l : T) (A : set M) : f @ within A (nbhs p) --> l <-> (forall u : M^nat, (forall n, A (u n)) /\ u @ \oo --> p -> f (u n) @[n --> \oo] --> l). @@ -319,10 +331,10 @@ apply: contrapT => fpl; move: ful; apply/existsNP. suff: exists2 u : M^nat, (forall k, A (u k)) /\ u @ \oo --> p & ~ f (u n) @[n --> \oo] --> l. by move=> [x_] h; exists x_; exact/not_implyP. -have [V Vnb hV] : exists2 V : set T, nbhs l V & forall d : {posnum R}, - exists xn : M, [/\ A xn, ball xn d%:num p & ~ V (f xn)]. +have [V Vnb hV] : exists2 V : set T, nbhs l V & forall e : {posnum R}, + exists xn : M, [/\ A xn, ball xn e%:num p & ~ V (f xn)]. apply: contrapT; apply: contra_not fpl => /forallPNP h. - move=> V Vnb; have /existsNP[d] := h V Vnb; move/forallNP => {}h. + move=> V Vnb; have /existsNP[e] := h V Vnb; move/forallNP => {}h. rewrite nbhs_nearE near_map near_withinE; near=> t => At. have /not_and3P[//|bp|/contrapT //] := h t. exfalso; apply: bp. @@ -340,8 +352,8 @@ exists (fun n => sval (cid (hV (PosNum (invn n))))). by rewrite /sval/=; case: cid => // x [Ax xpN]. Unshelve. all: by end_near. Qed. -Lemma cvg_nbhsP {T : topologicalType} {R : archiRealFieldType} - {M : pseudoMetricType R} (f : M -> T) (p : M) (l : T) : +Lemma cvg_nbhsP {d} {T : topologicalType d} {R : archiRealFieldType} + {M : pseudoMetricType d R} (f : M -> T) (p : M) (l : T) : f @ p --> l <-> (forall u : M^nat, u @ \oo --> p -> f (u n) @[n --> \oo] --> l). Proof. @@ -353,7 +365,8 @@ Qed. Section entourages. Context {R : numDomainType}. -Lemma unif_continuousP (U V : pseudoMetricType R) (f : U -> V) : +Lemma unif_continuousP {d d'} + (U : pseudoMetricType d R) (V : pseudoMetricType d' R) (f : U -> V) : unif_continuous f <-> forall e, e > 0 -> exists2 d, d > 0 & forall x, ball x.1 d x.2 -> ball (f x.1) e (f x.2). @@ -365,7 +378,7 @@ Qed. End entourages. -Lemma countable_uniformity_metric {R : realType} {T : pseudoMetricType R} : +Lemma countable_uniformity_metric d {R : realType} {T : pseudoMetricType d R} : countable_uniformity T. Proof. apply/countable_uniformityP. @@ -445,18 +458,19 @@ End pseudoMetric_of_normedDomain. HB.instance Definition _ (R : zmodType) := Pointed.on R^o. #[short(type="completePseudoMetricType")] -HB.structure Definition CompletePseudoMetric R := - {T of Complete T & PseudoPointedMetric R T}. +HB.structure Definition CompletePseudoMetric d R := + {T of Complete d T & PseudoPointedMetric d R T}. +HB.saturate with_fdisp. -Definition cauchy_ex {R : numDomainType} {T : pseudoMetricType R} +Definition cauchy_ex d {R : numDomainType} {T : pseudoMetricType d R} (F : set_system T) := forall eps : R, 0 < eps -> exists x, F (ball x eps). -Definition cauchy_ball {R : numDomainType} {T : pseudoMetricType R} +Definition cauchy_ball d {R : numDomainType} {T : pseudoMetricType d R} (F : set_system T) := forall e, e > 0 -> \forall x & y \near F, ball x e y. -Lemma cauchy_ballP (R : numDomainType) (T : pseudoMetricType R) +Lemma cauchy_ballP d (R : numDomainType) (T : pseudoMetricType d R) (F : set_system T) (FF : Filter F) : cauchy_ball F <-> cauchy F. Proof. @@ -465,19 +479,19 @@ split=> cauchyF; last first. move=> U; rewrite -entourage_ballE => - [_/posnumP[eps] xyepsU]. by near do apply: xyepsU; apply: cauchyF. Unshelve. all: by end_near. Qed. -Arguments cauchy_ballP {R T} F {FF}. +Arguments cauchy_ballP {d R T} F {FF}. -Lemma cauchy_exP (R : numFieldType) (T : pseudoMetricType R) +Lemma cauchy_exP d (R : numFieldType) (T : pseudoMetricType d R) (F : set_system T) (FF : Filter F) : cauchy_ex F -> cauchy F. Proof. move=> Fc A; rewrite !nbhs_simpl /= -entourage_ballE => -[_/posnumP[e] sdeA]. have /Fc [z /= Fze] := [gt0 of e%:num / 2]; near=> x y; apply: sdeA => /=. -by apply: (@ball_splitr _ _ z); [near: x|near: y]. +by apply: (@ball_splitr _ _ _ z); [near: x|near: y]. Unshelve. all: by end_near. Qed. -Arguments cauchy_exP {R T} F {FF}. +Arguments cauchy_exP {d R T} F {FF}. -Lemma cauchyP (R : numFieldType) (T : pseudoMetricType R) +Lemma cauchyP d (R : numFieldType) (T : pseudoMetricType d R) (F : set_system T) (PF : ProperFilter F) : cauchy F <-> cauchy_ex F. Proof. @@ -485,16 +499,16 @@ split=> [Fcauchy _/posnumP[e] |/cauchy_exP//]. near F => x; exists x; near: x; apply: (@nearP_dep _ _ F F). exact/Fcauchy/entourage_ball. Unshelve. all: by end_near. Qed. -Arguments cauchyP {R T} F {PF}. +Arguments cauchyP {d R T} F {PF}. Definition closed_ball_ {R : numDomainType} {V : zmodType} (norm : V -> R) (x : V) (e : R) := [set y | norm (x - y) <= e]. -Definition closed_ball {R : numDomainType} {V : pseudoMetricType R} +Definition closed_ball d {R : numDomainType} {V : pseudoMetricType d R} (x : V) (e : R) := closure (ball x e). Section closed_ball_lemmas. -Context {R : numDomainType} {V : pseudoMetricType R}. +Context {d} {R : numDomainType} {V : pseudoMetricType d R}. Implicit Types (x : V) (r : R). Lemma closure_ballE x r : closure (ball x r) = closed_ball x r. @@ -517,10 +531,19 @@ End closed_ball_lemmas. #[deprecated(since="mathcomp-analysis 1.14.0", note="renamed to `closure_ballE`")] Notation closure_ball := closure_ballE (only parsing). -Lemma subset_closure_half {R : numFieldType} {V : pseudoMetricType R} (x : V) - (r : R) : 0 < r -> closed_ball x (r / 2) `<=` ball x r. +Lemma subset_closure_half d {R : numFieldType} {V : pseudoMetricType d R} + (x : V) (r : R) : + 0 < r -> closed_ball x (r / 2) `<=` ball x r. Proof. move:r => _/posnumP[r] z /(_ (ball z ((r%:num/2)%:pos)%:num)) []. exact: nbhsx_ballx. by move=> y [+/ball_sym]; rewrite [t in ball x t z]splitr; apply: ball_triangle. Qed. + +Module ExplicitNbhsDisplays. +Export uniform_structure.ExplicitNbhsDisplays. + +Notation "d .-ball" := (@ball d _ _). +Notation "'ball'" := (@ball default_fdisp _ _) (only printing). + +End ExplicitNbhsDisplays. \ No newline at end of file diff --git a/theories/topology_theory/quotient_topology.v b/theories/topology_theory/quotient_topology.v index ca77bc2042..56cf001335 100644 --- a/theories/topology_theory/quotient_topology.v +++ b/theories/topology_theory/quotient_topology.v @@ -21,14 +21,19 @@ Unset Printing Implicit Defensive. Local Open Scope classical_set_scope. Local Open Scope ring_scope. +Fact quotient_fdisp : fdisp_t. +Proof. by []. Qed. Definition quotient_topology (T : Type) (Q : quotType T) : Type := Q. +Notation "'quot'" := (quotient_fdisp) (only printing) : fdisp_scope. + Section quotients. Local Open Scope quotient_scope. Section unpointed. -Context {T : topologicalType} {Q0 : quotType T}. +Context {d} {T : topologicalType d} {Q0 : quotType T}. Local Notation Q := (quotient_topology Q0). +Local Notation dQ := quotient_fdisp. HB.instance Definition _ := Quotient.copy Q Q0. HB.instance Definition _ := [Sub Q of T by %/]. @@ -37,7 +42,7 @@ HB.instance Definition _ := [Choice of Q by <:]. Definition quotient_open U := open (\pi_Q @^-1` U). Program Definition quotient_topologicalType_mixin := - @isOpenTopological.Build Q quotient_open _ _ _. + @isOpenTopological.Build dQ Q quotient_open _ _ _. Next Obligation. by rewrite /quotient_open preimage_setT; exact: openT. Qed. Next Obligation. by move=> ? ? ? ?; exact: openI. Qed. Next Obligation. by move=> I f ofi; apply: bigcup_open => i _; exact: ofi. Qed. @@ -46,14 +51,14 @@ HB.instance Definition _ := quotient_topologicalType_mixin. Lemma pi_continuous : continuous (\pi_Q : T -> Q). Proof. exact/continuousP. Qed. -Lemma quotient_continuous {Z : topologicalType} (f : Q -> Z) : +Lemma quotient_continuous {d'} {Z : topologicalType d'} (f : Q -> Z) : continuous f <-> continuous (f \o \pi_Q). Proof. split => /continuousP /= cts; apply/continuousP => A oA; last exact: cts. by rewrite comp_preimage; move/continuousP: pi_continuous; apply; exact: cts. Qed. -Lemma repr_comp_continuous (Z : topologicalType) (g : T -> Z) : +Lemma repr_comp_continuous {d'} (Z : topologicalType d') (g : T -> Z) : continuous g -> {homo g : a b / \pi_Q a == \pi_Q b :> Q >-> a == b} -> continuous (g \o repr : Q -> Z). Proof. @@ -66,7 +71,7 @@ Qed. End unpointed. Section pointed. -Context {T : ptopologicalType} {Q0 : quotType T}. +Context {d} {T : ptopologicalType d} {Q0 : quotType T}. Local Notation Q := (quotient_topology Q0). HB.instance Definition _ := isPointed.Build Q (\pi_Q point : Q). End pointed. diff --git a/theories/topology_theory/separation_axioms.v b/theories/topology_theory/separation_axioms.v index e358eba40f..99e16226b7 100644 --- a/theories/topology_theory/separation_axioms.v +++ b/theories/topology_theory/separation_axioms.v @@ -51,6 +51,13 @@ From mathcomp Require Import topology_structure compact subspace_topology (* ``` *) (******************************************************************************) +Reserved Notation "d .-close" (at level 5, format "d .-close"). +Reserved Notation "d .-totally_disconnected" + (at level 5, format "d .-totally_disconnected"). +Reserved Notation "d .-zero_dimensional" + (at level 5, format "d .-zero_dimensional"). +Reserved Notation "d .-perfect_set" (at level 5, format "d .-perfect_set"). + Unset SsrOldRewriteGoalsOrder. (* remove the line when requiring MathComp >= 2.6 *) Set Implicit Arguments. Unset Strict Implicit. @@ -61,7 +68,7 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. Section set_nbhs. -Context {T : topologicalType} (A : set T). +Context {d} {T : topologicalType d} (A : set T). Definition set_nbhs := \bigcap_(x in A) nbhs x. @@ -95,7 +102,7 @@ Qed. End set_nbhs. Section point_separation_axioms. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Definition kolmogorov_space := forall x y, x != y -> exists A : set T, (A \in nbhs x /\ y \in ~` A) \/ (A \in nbhs y /\ x \in ~` A). @@ -194,11 +201,11 @@ Qed. End point_separation_axioms. -Arguments hausdorff_space : clear implicits. -Arguments accessible_space : clear implicits. -Arguments kolmogorov_space : clear implicits. +Arguments hausdorff_space {d} T. +Arguments accessible_space {d} T. +Arguments kolmogorov_space {d} T. -Lemma limit_point_closed {T : topologicalType} (A : set T) : +Lemma limit_point_closed {d} {T : topologicalType d} (A : set T) : accessible_space T -> closed (limit_point A). Proof. move=> accT; rewrite -openC openE/= => a. @@ -221,22 +228,23 @@ apply: (@subset_trans _ ([set a] `&` [set~ a])). by rewrite setIA; exact: setSI. by rewrite setICr. Qed. -Arguments limit_point_closed {T} A. +Arguments limit_point_closed {d T} A. -Lemma subspace_hausdorff {T : topologicalType} (A : set T) : +Lemma subspace_hausdorff {d} {T : topologicalType d} (A : set T) : hausdorff_space T -> hausdorff_space (subspace A). Proof. rewrite ?open_hausdorff => + x y xNy => /(_ x y xNy). move=> [[P Q]] /= [Px Qx] /= [/open_subspaceW oP /open_subspaceW oQ]. -by move=> ?; exists (P, Q); split => //=; [exact: oP | exact: oQ]. +by move=> ?; exists (P, Q); split. Qed. -Lemma discrete_hausdorff {T : discreteTopologicalType} : hausdorff_space T. +Lemma discrete_hausdorff {d} {T : discreteTopologicalType d} : + hausdorff_space T. Proof. by move=> p q /(_ _ _ (discrete_set1 p) (discrete_set1 q)) [] // x [] -> ->. Qed. -Lemma order_hausdorff {d} {T : orderTopologicalType d} : hausdorff_space T. +Lemma order_hausdorff {td od} {T : orderTopologicalType td od} : hausdorff_space T. Proof. rewrite open_hausdorff=> p q; wlog : p q / (p < q)%O. have /orP[] := le_total p q; rewrite le_eqVlt => /predU1P[->|]. @@ -258,7 +266,7 @@ move=> npzq; exists (`]-oo, q[, `]p, +oo[)%classic; split => //=. Qed. Section ball_hausdorff. -Variables (R : numDomainType) (T : pseudoMetricType R). +Context d (R : numDomainType) (T : pseudoMetricType d R). Lemma ball_hausdorff : hausdorff_space T = forall (a b : T), a != b -> @@ -282,7 +290,7 @@ Import numFieldTopology.Exports. Lemma Rhausdorff (R : realFieldType) : hausdorff_space R. Proof. exact: order_hausdorff. Qed. -Lemma one_point_compactification_hausdorff {X : topologicalType} : +Lemma one_point_compactification_hausdorff {d} {X : topologicalType d} : locally_compact [set: X] -> hausdorff_space X -> hausdorff_space (one_point_compactification X). @@ -305,7 +313,7 @@ move=> lcpt hsdfX [x|] [y|] //=. Qed. Section hausdorff_topologicalType. -Variable T : topologicalType. +Context d (T : topologicalType d). Implicit Types x y : T. Local Open Scope classical_set_scope. @@ -375,7 +383,7 @@ Proof. by move=> ffun fx fy; rewrite -closeE //; exact: cvgi_close. Qed. End hausdorff_topologicalType. Section hausdorff_ptopologicalType. -Variable T : ptopologicalType. +Context d (T : ptopologicalType d). Implicit Types x y : T. Lemma close_cvg (F1 F2 : set_system T) {FF2 : ProperFilter F2} : @@ -383,7 +391,7 @@ Lemma close_cvg (F1 F2 : set_system T) {FF2 : ProperFilter F2} : Proof. move=> F12 F21. have [/(cvg_trans F21) F2l|dvgF1] := pselect (cvg F1). - by apply: (@cvg_close _ F2) => //; apply: cvgP F2l. + by apply: (@cvg_close _ _ F2) => //; apply: cvgP F2l. have [/(cvg_trans F12)/cvgP//|dvgF2] := pselect (cvg F2). rewrite dvgP // dvgP //; exact/close_refl. Qed. @@ -413,10 +421,11 @@ Qed. End hausdorff_ptopologicalType. #[global] Hint Resolve close_refl : core. -Arguments close_cvg {T} F1 F2 {FF2} _. +Arguments close_cvg {d T} F1 F2 {FF2} _. Section close_uniform. -Implicit Types (U : uniformType). +Context {d : fdisp_t}. +Implicit Types (U : uniformType d). Lemma entourage_close {U} (x y : U) : close x y = forall A, entourage A -> A (x, y). @@ -447,23 +456,23 @@ apply/xsectionP; apply: (entourage_split x) => //. by have := cxy _ (entourage_inv (entourage_split_ent entA)). Qed. -Lemma cvg_closeP {U : puniformType} (F : set_system U) (l : U) : +Lemma cvg_closeP {U : puniformType d} (F : set_system U) (l : U) : ProperFilter F -> F --> l <-> ([cvg F in U] /\ close (lim F) l). Proof. move=> FF; split=> [Fl|[cvF]Cl]. - by have /cvgP := Fl; split=> //; apply: (@cvg_close _ F). + by have /cvgP := Fl; split=> //; apply: (@cvg_close _ _ F). by apply: cvg_trans (close_cvgxx Cl). Qed. -Lemma ball_close {R : numFieldType} {M : pseudoMetricType R} (x y : M) : +Lemma ball_close {R : numFieldType} {M : pseudoMetricType d R} (x y : M) : close x y = forall eps : {posnum R}, ball x eps%:num y. Proof. rewrite propeqE; split => [cxy eps|cxy]. have := [elaborate cxy _ (open_nbhs_ball _ (eps%:num/2)%:pos)]. rewrite closureEonbhs/= meetsC meets_globallyr. move/(_ _ (open_nbhs_ball _ (eps%:num/2)%:pos)) => [z [zx zy]]. - by apply: (@ball_splitl _ _ z); apply: interior_subset. + by apply: (@ball_splitl _ _ _ z); apply: interior_subset. rewrite closeEnbhs => B A /nbhs_ballP[_/posnumP[e2 e2B]] /nbhs_ballP[_/posnumP[e1 e1A]]. by exists y; split; [apply/e2B|apply/e1A; exact: ballxx]. @@ -471,7 +480,7 @@ Qed. End close_uniform. Section set_separations. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Definition normal_space := forall A : set T, closed A -> @@ -483,7 +492,7 @@ Definition regular_space := Lemma compact_regular (x : T) V : hausdorff_space T -> compact V -> nbhs x V -> {for x, regular_space}. Proof. -move=> sep cptv Vx; apply: (@compact_cluster_set1 T x _ V) => //. +move=> sep cptv Vx; apply: (@compact_cluster_set1 _ T x _ V) => //. - apply: filter_from_proper => //; first last. by move=> ? /nbhs_singleton/subset_closure ?; exists x. apply: filter_from_filter; first by exists setT; exact: filterT. @@ -528,7 +537,7 @@ have cvP (x : T) : A x -> \forall x' \near x & i \near F, (~` i) x'. move=> nBZ; apply: filterS; first exact: subset_closure. apply: open_nbhs_nbhs; split; first exact/closed_openC/closed_closure. exact/(subsetC _ nBZ)/(subset_trans cDC). - by have := @closed_closure _ (~` closure D); rewrite closure_id => <-. + by have := @closed_closure _ _ (~` closure D); rewrite closure_id => <-. near=> y U => /=; have Dy : D° y by exact: (near nD _). have UclD : U `<=` closure (~` closure D). exact: (near (small_set_sub snBD) U). @@ -556,7 +565,7 @@ Arguments normal_space : clear implicits. Arguments regular_space : clear implicits. Local Open Scope relation_scope. -Lemma uniform_regular {T : uniformType} : @regular_space T. +Lemma uniform_regular {d} {T : uniformType d} : @regular_space _ T. Proof. move=> x R /=; rewrite -{1}nbhs_entourageE => -[E entE ER]. pose E' := split_ent E; have eE' : entourage E' by exact: entourage_split_ent. @@ -574,7 +583,8 @@ Local Close Scope relation_scope. #[global] Hint Resolve uniform_regular : core. Section totally_disconnected. -Implicit Types T : topologicalType. +Context {d : fdisp_t}. +Implicit Types (T : topologicalType d). Definition totally_disconnected {T} (A : set T) := forall x, A x -> connected_component A x = [set x]. @@ -582,7 +592,8 @@ Definition totally_disconnected {T} (A : set T) := Definition zero_dimensional T := (forall x y, x != y -> exists U : set T, [/\ clopen U, U x & ~ U y]). -Lemma discrete_zero_dimension {T : discreteTopologicalType} : zero_dimensional T. +Lemma discrete_zero_dimension {T : discreteTopologicalType d} : + zero_dimensional T. Proof. move=> x y xny; exists [set x]; split => //; last exact/nesym/eqP. by split; [exact: discrete_open | exact: discrete_closed]. @@ -624,7 +635,7 @@ move=> /(_ _ _ setC (powerset_filter_from_filter PF))[]. by move=> D [DF _ [C DC]]/(_ _ DC)/subsetC2/filterS; apply; exact: DF. Qed. -Lemma zero_dimensional_ray {d} {T : orderTopologicalType d} (x y : T) : +Lemma zero_dimensional_ray {od} {T : orderTopologicalType d od} (x y : T) : (x < y)%O -> zero_dimensional T -> exists U, [/\ clopen U, U y , ~ U x & forall l r, U r -> ~ U l -> l < r]%O. Proof. @@ -668,9 +679,9 @@ End totally_disconnected. Module countable_uniform. Section countable_uniform. Local Open Scope relation_scope. -Context {R : realType} {T : uniformType}. +Context {d} {R : realType} {T : uniformType d}. -Hypothesis cnt_unif : @countable_uniformity T. +Hypothesis cnt_unif : @countable_uniformity _ T. Let f_ := projT1 (cid2 (iffLR countable_uniformityP cnt_unif)). @@ -955,12 +966,12 @@ Qed. Definition type : Type := let _ := countableBase in let _ := entF in T. #[export] HB.instance Definition _ := Uniform.on type. -#[export] HB.instance Definition _ := Uniform_isPseudoMetric.Build R type +#[export] HB.instance Definition _ := Uniform_isPseudoMetric.Build d R type step_ball_center step_ball_sym step_ball_triangle step_ball_entourage. #[export] HB.instance Definition _ {q : Pointed T} := Pointed.copy type (Pointed.Pack q). -Lemma countable_uniform_bounded (x y : T) : @ball _ type x 2 y. +Lemma countable_uniform_bounded (x y : T) : @ball _ _ type x 2 y. Proof. rewrite /ball; exists O%N; rewrite /n_step_ball; split; rewrite // /distN. rewrite (_ : Num.truncn _ = 0)//. @@ -976,11 +987,12 @@ Export countable_uniform.Exports. Notation countable_uniform := countable_uniform.type. Definition sup_pseudometric (R : realType) (T : Type) (Ii : Type) - (Tc : Ii -> PseudoMetric R T) (Icnt : countable [set: Ii]) : Type := T. + (d : Ii -> fdisp_t) (Tc : forall i, PseudoMetric (d i) R T) + (Icnt : countable [set: Ii]) : Type := T. Section sup_pseudometric. Variable (R : realType) (T : choiceType) (Ii : Type). -Variable (Tc : Ii -> PseudoMetric R T). +Variable (d : Ii -> fdisp_t) (Tc : forall i, PseudoMetric (d i) R T). Hypothesis Icnt : countable [set: Ii]. @@ -988,10 +1000,10 @@ Local Notation S := (sup_pseudometric Tc Icnt). Let TS := fun i => PseudoMetric.Pack (Tc i). -Let countable_uniformityT := @countable_sup_ent T Ii Tc Icnt - (fun i => @countable_uniformity_metric _ (TS i)). +Let countable_uniformityT := @countable_sup_ent T Ii d Tc Icnt + (fun i => @countable_uniformity_metric _ _ (TS i)). -HB.instance Definition _ : PseudoMetric R S := +HB.instance Definition _ : PseudoMetric (supremum_fdisp d) R S := PseudoMetric.on (countable_uniform countable_uniformityT). End sup_pseudometric. @@ -1000,11 +1012,11 @@ Module gauge. Section gauge. Local Open Scope relation_scope. -Let split_sym {T : uniformType} (W : set (T * T)) := +Let split_sym {d} {T : uniformType d} (W : set (T * T)) := (split_ent W) `&` (split_ent W)^-1. Section entourage_gauge. -Context {T : uniformType} (E : set (T * T)) (entE : entourage E). +Context {d} {T : uniformType d} (E : set (T * T)) (entE : entourage E). Definition gauge := filter_from [set: nat] (fun n => iter n split_sym (E `&` E^-1)). @@ -1056,7 +1068,8 @@ Let gauged : Type := T. HB.instance Definition _ := Choice.on gauged. HB.instance Definition _ := - @isUniform.Build gauged gauge gauge_filter gauge_refl gauge_inv gauge_split. + @isUniform.Build default_fdisp + gauged gauge gauge_filter gauge_refl gauge_inv gauge_split. Lemma gauge_countable_uniformity : countable_uniformity gauged. Proof. @@ -1073,14 +1086,14 @@ Module Exports. HB.reexport. End Exports. End gauge. Export gauge.Exports. -Lemma uniform_pseudometric_sup {R : realType} {T : puniformType} : - @entourage T = @sup_ent T {E : set (T * T) | @entourage T E} - (fun E => Uniform.class (@gauge.type T (projT1 E) (projT2 E))). +Lemma uniform_pseudometric_sup {d} {R : realType} {T : puniformType d} : + @entourage _ T = @sup_ent T {E : set (T * T) | @entourage _ T E} + _ (fun E => Uniform.class (@gauge.type _ T (projT1 E) (projT2 E))). Proof. rewrite eqEsubset; split => [E entE|E]. exists E => //=. pose pe : {classic {E0 : set (T * T) | _}} * _ := (exist _ E entE, E). - have entPE : `[< @entourage (gauge.type entE) E >]. + have entPE : `[< @entourage _ (gauge.type entE) E >]. by apply/asboolP; exists 0%N => // ? []. exists (fset1 (exist _ pe entPE)) => //=; first by move=> ?; rewrite in_setE. by rewrite set_fset1 bigcap_set1. @@ -1090,8 +1103,8 @@ exact: gauge.iter_split_ent. Qed. Section perfect_sets. - -Implicit Types (T : topologicalType). +Context {d : fdisp_t}. +Implicit Types (T : topologicalType d). Definition perfect_set {T} (A : set T) := closed A /\ limit_point A = A. @@ -1136,7 +1149,8 @@ Qed. End perfect_sets. Section sigT_separations. -Context {I : choiceType} {X : I -> topologicalType}. +Context {I : choiceType} {d : I -> fdisp_t}. +Context {X : forall i, topologicalType (d i)}. Lemma sigT_hausdorff : (forall i, hausdorff_space (X i)) -> hausdorff_space {i & X i}. @@ -1153,3 +1167,22 @@ by rewrite -(existT_inj2 lr). Qed. End sigT_separations. + +Module ExplicitNbhsDisplays. +Export subspace_topology.ExplicitNbhsDisplays. + +Notation "d .-close" := (@close d _). +Notation "'close'" := (@close default_fdisp _) (only printing). + +Notation "d .-totally_disconnected" := (@totally_disconnected d _). +Notation "'totally_disconnected'" := + (@totally_disconnected default_fdisp _) (only printing). + +Notation "d .-zero_dimensional" := (@zero_dimensional d _). +Notation "'zero_dimensional'" := + (@zero_dimensional default_fdisp _) (only printing). + +Notation "d .-perfect_set" := (@perfect_set d _). +Notation "'perfect_set'" := (@perfect_set default_fdisp _) (only printing). + +End ExplicitNbhsDisplays. \ No newline at end of file diff --git a/theories/topology_theory/sigT_topology.v b/theories/topology_theory/sigT_topology.v index 61ab361868..3f582e4966 100644 --- a/theories/topology_theory/sigT_topology.v +++ b/theories/topology_theory/sigT_topology.v @@ -15,13 +15,21 @@ From mathcomp Require Import topology_structure compact subspace_topology. (* ``` *) (******************************************************************************) +Reserved Notation "X .-sig" (at level 4, format "X .-sig"). + Unset SsrOldRewriteGoalsOrder. (* remove the line when requiring MathComp >= 2.6 *) Local Open Scope classical_set_scope. Local Open Scope ring_scope. +Fact sigT_fdisp {I : choiceType} : (I -> fdisp_t) -> fdisp_t. +Proof. by []. Qed. + +Notation "X .-sig" := (sigT_fdisp X) : fdisp_scope. + Section sigT_topology. -Context {I : choiceType} {X : I -> topologicalType}. +Context {I : choiceType} {d : I -> fdisp_t}. +Context {X : forall i, topologicalType (d i)}. Definition sigT_nbhs (x : {i & X i}) : set_system {i & X i} := existT _ _ @ nbhs (projT2 x). @@ -30,7 +38,8 @@ Lemma sigT_nbhsE (i : I) (x : X i) : sigT_nbhs (existT _ i x) = (existT _ _) @ (nbhs x). Proof. by done. Qed. -HB.instance Definition _ := hasNbhs.Build {i & X i} sigT_nbhs. +HB.instance Definition _ := + hasNbhs.Build (sigT_fdisp d) {i & X i} sigT_nbhs. Local Lemma sigT_nbhs_proper x : ProperFilter (sigT_nbhs x). Proof. by case: x => i xi; exact: fmap_proper_filter. Qed. @@ -45,7 +54,7 @@ rewrite sigT_nbhsE /= nbhsE /= => -[W [oW Wz WlA]]. by exists W => // x /= Wx; exact/(filterS WlA)/open_nbhs_nbhs. Qed. -HB.instance Definition _ := Nbhs_isNbhsTopological.Build {i & X i} +HB.instance Definition _ := Nbhs_isNbhsTopological.Build _ {i & X i} sigT_nbhs_proper sigT_nbhs_singleton sigT_nbhs_nbhs. Lemma existT_continuous (i : I) : continuous (existT X i). @@ -71,7 +80,7 @@ rewrite openE => -[i x Uxi]. by rewrite /interior /nbhs/= sigT_nbhsE; exact: open_nbhs_nbhs. Qed. -Lemma sigT_continuous {Z : topologicalType} (f : forall i, X i -> Z) : +Lemma sigT_continuous {d'} {Z : topologicalType d'} (f : forall i, X i -> Z) : (forall i, continuous (f i)) -> continuous (sigT_fun f). Proof. by move=> ctsf [] i x U nU; apply: existT_continuous; exact: ctsf. Qed. diff --git a/theories/topology_theory/subspace_topology.v b/theories/topology_theory/subspace_topology.v index 9184193658..16e5a08be7 100644 --- a/theories/topology_theory/subspace_topology.v +++ b/theories/topology_theory/subspace_topology.v @@ -11,24 +11,25 @@ From mathcomp Require Import product_topology. (* # Subspaces of topological spaces *) (* *) (* ``` *) -(* subspace A == for (A : set T), this is a copy of T with a *) -(* topology that ignores points outside A *) -(* incl_subspace x == with x of type subspace A with (A : set T), *) -(* inclusion of subspace A into T *) -(* nbhs_subspace x == filter associated with x : subspace A *) -(* from_subspace A f == function of type `subspace A -> U` given a *) -(* function f of type `A -> U` *) -(* The purpose of this definition is to *) -(* preserve the pretty-printing of the notation *) -(* {within _, continuous _} below. Its use is *) -(* however likely to be later superseded by a *) -(* better (compositional) mechanism. *) -(* {within A, continuous f} := continuous (from_subspace A f)) *) -(* subspace_ent A == subspace entourages *) -(* subspace_ball A == balls of the pseudometric subspace structure *) -(* continuousSubspaceType A B == type of continuous functions from set A to *) -(* set B with domain subspace A *) -(* The HB structure is ContinuousFun. *) +(* subspace A == for (A : set T), this is a copy of T *) +(* with a topology that ignores points *) +(* outside A *) +(* incl_subspace x == with x of type subspace A with *) +(* (A : set T), inclusion of subspace A *) +(* into T *) +(* nbhs_subspace x == filter associated with x : subspace A *) +(* {within A, continuous f} == f is continuous as a function with *) +(* domain subspace A *) +(* {into B, continuous f} == f is continuous as a function with *) +(* codomain subspace B *) +(* {within A & into B, continuous f} == f is continuous as a function with *) +(* domain subspace A, codomain subspace B*) +(* subspace_ent A == subspace entourages *) +(* subspace_ball A == balls of the pseudometric *) +(* subspace structure *) +(* continuousSubspaceType A B == type of continuous functions from *) +(* set A to set B with domain subspace A *) +(* The HB structure is ContinuousFun. *) (* ``` *) (* *) (* `subdiagonal X` *) @@ -36,8 +37,23 @@ From mathcomp Require Import product_topology. (* *) (******************************************************************************) +Reserved Notation "A .-sub" (at level 4, format "A .-sub"). Reserved Notation "{ 'within' A , 'continuous' f }" (format "{ 'within' A , 'continuous' f }"). +Reserved Notation "{ 'into' B , 'continuous' f }" + (format "{ 'into' B , 'continuous' f }"). +Reserved Notation "{ 'within' A & 'into' B , 'continuous' f }" + (format "{ 'within' A & 'into' B , 'continuous' f }"). +Reserved Notation "{ 'within' A , E @[ x --> F ] --> l }" + (x name, format "{ 'within' A , E @[ x --> F ] --> l }"). +Reserved Notation "{ 'into' B , F --> l }" + (format "{ 'into' B , F --> l }"). +Reserved Notation "{ 'within' A & 'into' B , E @[ x --> F ] --> l }" + (x name, format "{ 'within' A & 'into' B , E @[ x --> F ] --> l }"). +Reserved Notation "A .-sub.-nbhs" (at level 5). +Reserved Notation "A .-sub.-entourage" (at level 5). +Reserved Notation "A .-sub.-ball" (at level 5). +Reserved Notation "A .-sub.-open" (at level 5). Set Implicit Arguments. Unset Strict Implicit. @@ -49,10 +65,15 @@ Local Open Scope ring_scope. Definition subspace {T : Type} (A : set T) := T. Arguments subspace {T} _ : simpl never. +Fact subspace_fdisp {T} (A : set T) : fdisp_t. +Proof. by []. Qed. + +Notation "A .-sub" := (subspace_fdisp A). + Definition incl_subspace {T A} (x : subspace A) : T := x. Section Subspace. -Context {T : topologicalType} (A : set T). +Context {d} {T : topologicalType d} (A : set T). Definition nbhs_subspace (x : subspace A) : set_system (subspace A) := if x \in A then within A (nbhs x) else globally [set x]. @@ -84,7 +105,8 @@ Qed. HB.instance Definition _ := Choice.copy (subspace A) _. -HB.instance Definition _ := hasNbhs.Build (subspace A) nbhs_subspace. +HB.instance Definition _ := hasNbhs.Build + (subspace_fdisp A) (subspace A) nbhs_subspace. Lemma nbhs_subspaceP (x : subspace A) : nbhs_subspace_spec x (A x) (~ A x) (x \in A) (nbhs x). @@ -100,14 +122,14 @@ case: nbhs_subspaceP => [|] Ap. by move=> E x ->; case: nbhs_subspaceP. Qed. -HB.instance Definition _ := Nbhs_isNbhsTopological.Build (subspace A) +HB.instance Definition _ := Nbhs_isNbhsTopological.Build _ (subspace A) nbhs_subspace_filter nbhs_subspace_singleton nbhs_subspace_nbhs. Lemma subspace_cvgP (F : set_system T) (x : T) : Filter F -> A x -> (F --> (x : subspace A)) <-> (F --> within A (nbhs x)). Proof. by case: _ / nbhs_subspaceP. Qed. -Lemma subspace_continuousP {S : topologicalType} (f : T -> S) : +Lemma subspace_continuousP {d'} {S : topologicalType d'} (f : T -> S) : continuous (f : subspace A -> S) <-> (forall x, A x -> f @ within A (nbhs x) --> f x) . Proof. @@ -118,14 +140,16 @@ rewrite /continuous_at; case: _ / (nbhs_subspaceP x) => Ax. by move=> ? /nbhs_singleton //= ?; rewrite nbhs_simpl => ? ->. Qed. -Lemma subspace_eq_continuous {S : topologicalType} (f g : subspace A -> S) : +Lemma subspace_eq_continuous {d'} {S : topologicalType d'} + (f g : subspace A -> S) : {in A, f =1 g} -> continuous f -> continuous g. Proof. rewrite ?subspace_continuousP => feq L x Ax; rewrite -(feq x) ?inE //. by apply: cvg_trans _ (L x Ax); apply: fmap_within_eq=> ? ?; rewrite feq. Qed. -Lemma continuous_subspace_in {U : topologicalType} (f : subspace A -> U) : +Lemma continuous_subspace_in {d'} {U : topologicalType d'} + (f : subspace A -> U) : continuous f = {in A, continuous f}. Proof. rewrite propeqE in_setP subspace_continuousP /continuous_at //=; split. @@ -180,8 +204,8 @@ Lemma open_subspaceTI (U : set (subspace A)) : Proof. by rewrite setIC open_subspaceIT. Qed. Lemma closed_subspaceT : closed (A : set (subspace A)). -Proof. -rewrite -(setCK A); +Proof. +rewrite -{2}(setCK A). by apply: open_closedC; rewrite -open_subspaceIT setICl; exact: open0. Qed. @@ -261,17 +285,17 @@ Proof. by move=> oA; rewrite -setIC closed_setIS. Qed. Lemma closure_subspaceW (U : set T) : U `<=` A -> closure (U : set (subspace A)) = closure (U : set T) `&` A. Proof. -have /closed_subspaceP := @closed_closure _ (U : set (subspace A)). -move=> [V clV VAclUA] /[dup] /(@closureS (subspace _)). +have /closed_subspaceP := @closed_closure _ _ (U : set (subspace A)). +move=> [V clV VAclUA] /[dup] /(@closureS _ (subspace _)). have /closure_id <- := closed_subspaceT => /setIidr <-; rewrite setIC. move=> UsubA; rewrite eqEsubset; split. apply: setSI; rewrite closureE. - apply: smallest_sub (@subset_closure _ U). + apply: smallest_sub (@subset_closure _ _ U). by apply: closed_subspaceW; exact: closed_closure. rewrite -VAclUA; apply: setSI; rewrite closureE //=. apply: smallest_sub => //; apply: subset_trans (@subIsetl _ V A). rewrite VAclUA subsetI; split => //. -exact: (@subset_closure _ (U : set (subspace A))). +exact: (@subset_closure _ _ (U : set (subspace A))). Qed. End SubspaceOpen. @@ -290,7 +314,7 @@ by apply: filterI; rewrite nbhs_simpl //; exact: Fp. Qed. Lemma clopen_connectedP : connected A <-> - (forall U, @clopen (subspace A) U -> + (forall U, @clopen _ (subspace A) U -> U `<=` A -> U !=set0 -> U = A). Proof. split. @@ -307,32 +331,91 @@ Qed. End Subspace. -HB.instance Definition _ {T : ptopologicalType} (A : set T) := +HB.instance Definition _ {d} {T : ptopologicalType d} (A : set T) := isPointed.Build (subspace A) point. -Global Instance subspace_filter {T : topologicalType} +Global Instance subspace_filter {d} {T : topologicalType d} (A : set T) (x : subspace A) : Filter (nbhs_subspace x) := nbhs_subspace_filter x. -Global Instance subspace_proper_filter {T : topologicalType} +Global Instance subspace_proper_filter {d} {T : topologicalType d} (A : set T) (x : subspace A) : ProperFilter (nbhs_subspace x) := nbhs_subspace_filter x. -Definition from_subspace {T U : Type} (A : set T) (f : T -> U) +Definition __deprecated__from_subspace {T U : Type} (A : set T) (f : T -> U) : subspace A -> U := f. -Arguments from_subspace {T U} A f. +Arguments __deprecated__from_subspace {T U} A f. -Notation "{ 'within' A , 'continuous' f }" := - (continuous (from_subspace A f)) : classical_set_scope. +#[deprecated(since="1.20.0")] +Abbreviation from_subspace := __deprecated__from_subspace (only parsing). -Arguments nbhs_subspaceP {T} A x. +Notation "{ 'within' A , 'continuous' f }" := + (continuous (f :> subspace A -> _)) (only parsing) : classical_set_scope. +Notation "{ 'within' A , 'continuous' f }" := + (forall x, @continuous_at (subspace_fdisp A) _ _ _ x f) + (only printing) : classical_set_scope. +Notation "{ 'within' A , E @[ x --> F ] --> l }" := + (E @[x --> (F :> set_system (subspace A))] --> l) + (only parsing). +Notation "{ 'within' A , E @[ x --> F ] --> l }" := + (fmap (fun x => E) (@nbhs (subspace_fdisp A) _ _ F) --> l) + (only printing). + +Notation "{ 'into' B , 'continuous' f }" := + (continuous (f :> _ -> subspace B)) (only parsing) + : classical_set_scope. +Notation "{ 'into' B , 'continuous' f }" := + (forall x, @continuous_at _ (subspace_fdisp B) _ _ x f) + (only printing) : classical_set_scope. +Notation "{ 'into' B , F --> l }" := + (F --> (l :> subspace B)) + (only parsing). +Notation "{ 'into' B , F --> l }" := + (cvg_to F (@nbhs (subspace_fdisp B) _ _ l)) + (only printing). +Notation "{ 'into' B , F --> l }" := + (cvg_to (nbhs F) (@nbhs (subspace_fdisp B) _ _ l)) + (only printing). + +Notation "{ 'within' A & 'into' B , 'continuous' f }" := + (continuous (f :> subspace A -> subspace B)) + (only parsing): classical_set_scope. +Notation "{ 'within' A & 'into' B , 'continuous' f }" := + (forall x, @continuous_at + (subspace_fdisp A) + (subspace_fdisp B) _ _ x f) + (only printing) : classical_set_scope. +Notation "{ 'within' A & 'into' B , E @[ x --> F ] --> l }" := + (E @[x --> (F :> set_system (subspace A))] --> (l :> subspace B)) + (only parsing). +Notation "{ 'within' A & 'into' B , E @[ x --> F ] --> l }" := + (cvg_to + (nbhs (fmap (fun x => E) (@nbhs (subspace_fdisp A) _ _ F))) + (@nbhs (subspace_fdisp B) _ _ l)) + (only printing). + +Module ExplicitNbhsDisplays. +Export connected.ExplicitNbhsDisplays. +Export compact.ExplicitNbhsDisplays. + +Notation "A .-sub.-nbhs" := (@nbhs _ _ (subspace A)) (only parsing). +Notation "A .-sub.-entourage" := (@entourage _ (subspace A)) (only parsing). +Notation "A .-sub.-ball" := (@ball _ _ (subspace A)) (only parsing). +Notation "A .-sub.-open" := (@open _ (subspace A)) (only parsing). +Notation "A .-sub.-compact" := (@compact _ (subspace A)) (only parsing). + +End ExplicitNbhsDisplays. + +Import ExplicitNbhsDisplays. + +Arguments nbhs_subspaceP {d T} A x. Section SubspaceRelative. -Context {T : topologicalType}. -Implicit Types (U : topologicalType) (A B : set T). +Context {d d' : fdisp_t} {T : topologicalType d}. +Implicit Types (U : topologicalType d') (A B : set T). Lemma nbhs_subspace_subset A B (x : T) : - A `<=` B -> nbhs (x : subspace B) `<=` nbhs (x : subspace A). + A `<=` B -> B.-sub.-nbhs x `<=` A.-sub.-nbhs x. Proof. rewrite /= => AB; case: (nbhs_subspaceP A); case: (nbhs_subspaceP B). - by move=> ? ?; apply: within_subset => //=; exact: (nbhs_filter x). @@ -348,7 +431,7 @@ Proof. by move=> ? ctsF ? ? ?; apply: (@nbhs_subspace_subset A B) => //; exact: ctsF. Qed. -Lemma nbhs_subspaceT (x : T) : nbhs (x : subspace setT) = nbhs x. +Lemma nbhs_subspaceT (x : T) : [set: T].-sub.-nbhs x = nbhs x. Proof. have [_|] := nbhs_subspaceP [set: T]; last by cbn. rewrite eqEsubset withinE; split => [W [V nbhsV]|W ?]; last by exists W. @@ -356,7 +439,7 @@ by rewrite 2!setIT => ->. Qed. Lemma continuous_subspaceT_for {U} A (f : T -> U) (x : T) : - A x -> {for x, continuous f} -> {for x, continuous (f : subspace A -> U)}. + A x -> {for x, continuous f} -> {for x, {within A, continuous f}}. Proof. rewrite /continuous_at /prop_for => inA ctsf. have [_|//] := nbhs_subspaceP A x. @@ -411,7 +494,7 @@ by case=> [][] ? ?; split=> []; [left | left | right | right]. Qed. Lemma subspaceT_continuous {U} A (B : set U) (f : {fun A >-> B}) : - {within A, continuous f} -> continuous (f : subspace A -> subspace B). + {within A, continuous f} -> {within A & into B, continuous f}. Proof. move=> /continuousP ctsf; apply/continuousP => O /open_subspaceP [V oV VBOB]. rewrite -open_subspaceIT; apply/open_subspaceP. @@ -439,10 +522,10 @@ End SubspaceRelative. Section SubspaceUniform. Local Open Scope relation_scope. -Context {X : uniformType} (A : set X). +Context {d} {X : uniformType d} (A : set X). Definition subspace_ent := - filter_from (@entourage X) + filter_from (@entourage _ X) (fun E => [set xy | (xy.1 = xy.2) \/ (A xy.1 /\ A xy.2 /\ E xy)]). Let Filter_subspace_ent : Filter subspace_ent. @@ -481,25 +564,25 @@ move=> [x y] [z /= Ez zE] /=; case: Ez; case: zE. by apply: subset_split_ent => //; exists z. Qed. -Let subspace_uniform_nbhsE : @nbhs _ (subspace A) = nbhs_ subspace_ent. +Let subspace_uniform_nbhsE : A.-sub.-nbhs = nbhs_ subspace_ent. Proof. pose EA := [set xy | xy.1 = xy.2 \/ A xy.1 /\ A xy.2]. have entEA : subspace_ent EA. exists setT; first exact: filterT. by move=> [??] /= [ ->|[?] [?]];[left|right]. rewrite funeq2E=> x U. -case: (@nbhs_subspaceP X A x); rewrite propeqE; split => //=. +case: (@nbhs_subspaceP _ X A x); rewrite propeqE; split => //=. - rewrite withinE; case=> V /[dup] nbhsV => [/nbhsP [E entE Esub] UV]. exists [set xy | xy.1 = xy.2 \/ A xy.1 /\ A xy.2 /\ E xy]. by exists E => //= [[? ?]] /= [->| [? []]//]; exact: entourage_refl. move=> y /= /xsectionP/= -[<-{y}|]. suff : (U `&` A) x by case. - by rewrite UV; split => //; exact: (@nbhs_singleton X). + by rewrite UV; split => //; exact: (@nbhs_singleton _ X). case=> _ [Ay Ey]; suff : (U `&` A) y by case. by rewrite UV; split => //; exact/Esub/xsectionP. - move=> [] W [E eentE subW] subU //=. near=> w; apply/subU/xsectionP/subW; right; repeat split => //=. - exact: (near (withinT _ (@nbhs_filter X _))). + exact: (near (withinT _ (@nbhs_filter _ X _))). by near: w; apply/nbhsP; exists E => // y /xsectionP. - move=> //= Ux; exists EA => //. by move=> y /xsectionP => -[|[]] //= <-; exact: Ux. @@ -507,7 +590,7 @@ case: (@nbhs_subspaceP X A x); rewrite propeqE; split => //=. by apply/subU/xsectionP/subW; left. Unshelve. all: by end_near. Qed. -HB.instance Definition _ := Nbhs_isUniform_mixin.Build (subspace A) +HB.instance Definition _ := Nbhs_isUniform_mixin.Build _ (subspace A) Filter_subspace_ent subspace_uniform_entourage_diagonal subspace_uniform_entourage_inv subspace_uniform_entourage_split_ex subspace_uniform_nbhsE. @@ -515,7 +598,7 @@ HB.instance Definition _ := Nbhs_isUniform_mixin.Build (subspace A) End SubspaceUniform. Section SubspacePseudoMetric. -Context {R : numDomainType} {X : pseudoMetricType R} (A : set X). +Context {d} {R : numDomainType} {X : pseudoMetricType d R} (A : set X). Implicit Type e : R. Definition subspace_ball (x : subspace A) (r : R) := @@ -544,7 +627,7 @@ rewrite /subspace_ball; (repeat case: ifP => /asboolP). - by move=> _ _ -> ->. Qed. -Let subspace_pm_entourageE : @entourage (subspace A) = entourage_ subspace_ball. +Let subspace_pm_entourageE : A.-sub.-entourage = entourage_ subspace_ball. Proof. rewrite eqEsubset; split; rewrite /subspace_ball. move=> U [W + subU]; rewrite -entourage_ballE => [[eps] nneg subW]. @@ -560,7 +643,7 @@ by case: ifP => /asboolP. Qed. HB.instance Definition _ := - @Uniform_isPseudoMetric.Build R (subspace A) subspace_ball + @Uniform_isPseudoMetric.Build _ R (subspace A) subspace_ball subspace_pm_ball_center subspace_pm_ball_sym subspace_pm_ball_triangle subspace_pm_entourageE. @@ -571,10 +654,10 @@ Proof. by []. Qed. End SubspacePseudoMetric. Section SubspaceInitial. -Context {T : topologicalType} {U : choiceType} (f : U -> T). +Context {d} {T : topologicalType d} {U : choiceType} (f : U -> T). Lemma initial_subspace_open (A : set (initial_topology f)) : - open A -> open (f @` A : set (subspace (range f))). + open A -> (range f).-sub.-open (f @` A). Proof. case=> B oB <-; apply/open_subspaceP; exists B => //; rewrite eqEsubset. split => z [] /[swap]; first by case=> w _ <- ?; split; exists w. @@ -583,7 +666,8 @@ Qed. End SubspaceInitial. -Lemma continuous_compact {T U : topologicalType} (f : T -> U) A : +Lemma continuous_compact {d d'} + {T : topologicalType d} {U : topologicalType d'} (f : T -> U) A : {within A, continuous f} -> compact A -> compact (f @` A). Proof. move=> fcont Aco F FF FfA; set G := filter_from F (fun C => A `&` f @^-1` C). @@ -600,8 +684,8 @@ have : image_set_system A f G B by exists B. by move=> /clsGp /(_ p_Cf) [q [[]]]; exists (f q). Qed. -Lemma connected_continuous_connected {T U : topologicalType} - (A : set T) (f : T -> U) : +Lemma connected_continuous_connected {d d'} + {T : topologicalType d} {U : topologicalType d'} (A : set T) (f : T -> U) : connected A -> {within A, continuous f} -> connected (f @` A). Proof. move=> cA cf; apply: contrapT => /connectedPn[E [E0 fAE sE]]. @@ -612,9 +696,10 @@ suff sAfE : separated (AfE false) (AfE true). have [t Et ftu] : (f @` A) u by rewrite fAE; case: b Ebu; [right|left]. by exists t; split => //=; rewrite /preimage ftu. - by rewrite -setIUr -preimage_setU -fAE; exact/esym/setIidPl/preimage_image. - + rewrite -{2}(setIid A) ?setIA -(@closure_subspaceW _ A); first by move=> ?[]. + + rewrite -{2}(setIid A) ?setIA -(@closure_subspaceW _ _ A); first by move=> ?[]. by rewrite -/(AfE false) -setIA -/(AfE true); case: sAfE. - + rewrite -{1}(setIid A) setIC ?setIA -(@closure_subspaceW _ A) => [? []//|]. + + rewrite -{1}(setIid A) setIC ?setIA -(@closure_subspaceW _ _ A) + => [? []//|]. by rewrite -/(AfE true) -setIA -/(AfE false) setIC; case: sAfE. suff cI0 b : closure (AfE b) `&` AfE (~~ b) = set0. by rewrite /separated cI0 setIC cI0. @@ -633,7 +718,7 @@ have ? : f @` closure (AfE b) `<=` closure (E b). have /closure_id -> : closed (f @^-1` closure (E b) : set (subspace A)). by apply: preimage_closed => //; exact: closed_closure. apply: closureS. - have /(@preimage_subset _ _ f) A0cA0 := @subset_closure _ (E b). + have /(@preimage_subset _ _ f) A0cA0 := @subset_closure _ _ (E b). by apply: subset_trans A0cA0; apply: subIset; right. by move/subset_trans; apply; exact: image_preimage_subset. apply/nonemptyPn => -[t [AfEb AfENb]]. @@ -642,7 +727,8 @@ have : f @` closure (AfE b) `&` f @` AfE (~~ b) = set0. by rewrite predeqE => /(_ (f t)) [fcAfEb] _; apply: fcAfEb; split; exists t. Qed. -Lemma continuous_localP {X Y : topologicalType} (f : X -> Y) : +Lemma continuous_localP {d d'} + {X : topologicalType d} {Y : topologicalType d'} (f : X -> Y) : continuous f <-> forall x : X, \forall U \near powerset_filter_from (nbhs x), {within U, continuous f}. @@ -657,15 +743,18 @@ move/nbhs_singleton: nbhsU; move: x; apply/in_setP. by rewrite -continuous_open_subspace. Unshelve. end_near. Qed. -Lemma continuous_subspace_setT {T U : topologicalType} (f : T -> U) : +Lemma continuous_subspace_setT {d d'} + {T : topologicalType d} {U : topologicalType d'} (f : T -> U) : continuous f <-> {within setT, continuous f}. Proof. by split => + x K nfK=> /(_ x K nfK); rewrite nbhs_subspaceT. Qed. Section subspace_product. -Context {X Y Z : topologicalType} (A : set X) (B : set Y) . +Context {d d' d''} + {X : topologicalType d} {Y : topologicalType d'} {Z : topologicalType d''} + (A : set X) (B : set Y). Lemma nbhs_prodX_subspace_inE x : (A `*` B) x -> - nbhs (x : subspace (A `*` B)) = @nbhs _ (subspace A * subspace B)%type x. + (A `*` B).-sub.-nbhs x = @nbhs _ _ (subspace A * subspace B)%type x. Proof. case: x => a b [/= Aa Bb]; rewrite /nbhs/= -nbhs_subspace_in//. rewrite funeqE => U /=; rewrite propeqE; split; rewrite /nbhs /=. @@ -691,9 +780,9 @@ Qed. End subspace_product. #[short(type = "continuousSubspaceType")] -HB.structure Definition ContinuousSubspace {X Y : topologicalType} - (A : set X) (B : set Y) := - {f of @isFun (subspace A) Y A B f & @Continuous (subspace A) Y f }. +HB.structure Definition ContinuousSubspace {d d'} + {X : topologicalType d} {Y : topologicalType d'} (A : set X) (B : set Y) := + {f of @isFun (subspace A) Y A B f & @Continuous _ _ (subspace A) Y f }. #[deprecated(since="mathcomp-analysis 1.16.0", note="renamed to `continuousSubspaceType`")] Notation continuousFunType := continuousSubspaceType. @@ -701,10 +790,12 @@ Notation continuousFunType := continuousSubspaceType. Notation ContinuousFun A B := (ContinuousSubspace A B). Section continuous_fun_comp. -Context {X Y Z : topologicalType} (A : set X) (B : set Y) (C : set Z) +Context {d d' d''} + {X : topologicalType d} {Y : topologicalType d'} {Z : topologicalType d''} + (A : set X) (B : set Y) (C : set Z) {f : continuousSubspaceType A B} {g : continuousSubspaceType B C}. -#[local] Lemma continuous_comp_subproof : continuous (g \o f : subspace A -> Z). +#[local] Lemma continuous_comp_subproof : {within A, continuous g \o f}. Proof. move=> x; apply: continuous_comp; last exact: continuous_fun. exact/subspaceT_continuous/continuous_fun. @@ -717,7 +808,8 @@ Qed. End continuous_fun_comp. Section continuous_patch. -Context {U V : topologicalType} (A B : set U) (f g : U -> V). +Context {d d'} {U : topologicalType d} {V : topologicalType d'} + (A B : set U) (f g : U -> V). Hypotheses (contf : {within A, continuous f}) (contg : {within B, continuous g}) (closedA : closed A) @@ -737,13 +829,13 @@ Qed. End continuous_patch. -Definition subdiagonal {X : uniformType} (A : set X) : +Definition subdiagonal {d} {X : uniformType d} (A : set X) : set (subspace A * subspace A) := [set z | (A z.1 /\ A z.2) \/ z.1 = z.2]. -Arguments subdiagonal {X} _. +Arguments subdiagonal {d X} _. -Lemma ent_subdiagonal {X : uniformType} (A : set X) : - @entourage (subspace A) (subdiagonal A). +Lemma ent_subdiagonal {d} {X : uniformType d} (A : set X) : + A.-sub.-entourage (subdiagonal A). Proof. rewrite -[entourage (subdiagonal A)]/(subspace_ent A (subdiagonal A)). rewrite /subspace_ent /filter_from /=. @@ -754,7 +846,7 @@ move=> z /= [z12|[A1 [A2 _]]]. Qed. Section HeineCantorUniform. -Context {X Y : uniformType}. +Context {d d'} {X : uniformType d} {Y : uniformType d'}. Let unif_cont_at (A : set X) (f : X -> Y) (E : set (Y * Y)) (i : subspace A * subspace A) (x : subspace A) : Prop := @@ -768,7 +860,8 @@ Proof. move=> cf entE. pose E' := split_ent E. pose W : set (Y * Y) := E' `&` E'^-1%relation. -have entW : @entourage Y W by apply: entourage_invI; exact: entourage_split_ent. +have entW : @entourage _ Y W. + by apply: entourage_invI; exact: entourage_split_ent. move=> a. have /nbhsP [/= C entC Csub] := cf a (xsection W (f a)) (nbhs_entourage (f a) entW). @@ -801,17 +894,17 @@ Unshelve. all: end_near. Qed. Lemma heine_cantor_subspace (A : set X) (f : X -> Y) : compact A -> {within A, continuous f} -> - @unif_continuous (subspace A) Y f. + @unif_continuous _ _ (subspace A) Y f. Proof. move=> cA cf E entE. rewrite -[nbhs _ E]/(subspace_ent A [set xy : subspace A * subspace A | E (f xy.1, f xy.2)]). -have compactA_subspace : @compact (subspace A) A. - rewrite -[A](@setTI (subspace A)). - have [_] := @compact_subspaceIP X A setT. +have compactA_subspace : A.-sub.-compact A. + rewrite -[A in compact A](@setTI (subspace A)). + have [_] := @compact_subspaceIP _ X A setT. by rewrite setTI; exact. have A_unif_cont_at : \forall V \near entourage, A `<=` @unif_cont_at A f E V. - have := (@compact_near_coveringP (subspace A) A).1 compactA_subspace. + have := (@compact_near_coveringP _ (subspace A) A).1 compactA_subspace. move/(_ _ entourage (@unif_cont_at A f E)). by apply=> a Aa; exact/unif_cont_atP. pose W : set (subspace A * subspace A) := [set z | A `<=` unif_cont_at f E z]. diff --git a/theories/topology_theory/subtype_topology.v b/theories/topology_theory/subtype_topology.v index 706ac0e9ce..d28be54ffc 100644 --- a/theories/topology_theory/subtype_topology.v +++ b/theories/topology_theory/subtype_topology.v @@ -29,23 +29,36 @@ From mathcomp Require Import product_topology subspace_topology. Unset SsrOldRewriteGoalsOrder. (* remove the line when requiring MathComp >= 2.6 *) +Reserved Notation "A .-type" (at level 4, format "A .-type"). + Local Open Scope classical_set_scope. Local Open Scope ring_scope. -HB.instance Definition _ {X : topologicalType} (A : set X) := - Topological.copy (set_type A) (initial_topology set_val). +Fact subtype_fdisp {T} (A : set T) : fdisp_t. +Proof. by []. Qed. + +Notation "A .-type" := (subtype_fdisp A) : fdisp_scope. + +Definition set_type_topology_def {d} {X : topologicalType d} (A : set X) := + with_fdisp (subtype_fdisp A) (initial_topology (set_val : A -> X)). -HB.instance Definition _ {X : uniformType} (A : set X) := - Uniform.copy (A : Type) (@initial_topology (A : Type) X set_val). +HB.instance Definition _ {d} {X : topologicalType d} (A : set X) := + Topological.copy (set_type A) (set_type_topology_def A). -HB.instance Definition _ {R : realType} {X : pseudoMetricType R} (A : set X) := - PseudoMetric.copy (A : Type) (@initial_topology (A : Type) X set_val). +HB.instance Definition _ {d} {X : uniformType d} (A : set X) := + Uniform.copy (A : Type) (set_type_topology_def A). + +HB.instance Definition _ {d} {R : realType} {X : pseudoMetricType d R} + (A : set X) := + PseudoMetric.copy (A : Type) (set_type_topology_def A). Section subspace_sig. -Context {X : topologicalType} (A : set X). +Context {d} {X : topologicalType d} (A : set X). + +Import ExplicitNbhsDisplays. Lemma subspace_subtypeP (x : A) (U : set A) : - nbhs x U <-> nbhs (set_val x : subspace A) (set_val @` U). + nbhs x U <-> A.-sub.-nbhs (set_val x) (set_val @` U). Proof. rewrite /nbhs /= -nbhs_subspace_in //. by case: x; rewrite set_valE => //= ? /set_mem. @@ -60,14 +73,14 @@ move=> w /= /V'V Vsw; have : (V `&` A) (\val w). by rewrite -UAVA => -[[v ? /eq_sig_hprop] <-]. Qed. -Lemma subspace_sigL_continuousP {Y : topologicalType} (f : X -> Y) : +Lemma subspace_sigL_continuousP {d'} {Y : topologicalType d'} (f : X -> Y) : {within A, continuous f} <-> continuous (sigL A f). Proof. split. - have /continuous_subspaceT/subspaceT_continuous := - @initial_continuous A X set_val. - move=> svf ctsf; apply/continuous_subspace_setT => x. - apply: (@continuous_comp (subspace _) (subspace A)); last exact: ctsf. + have /continuous_subspaceT/subspaceT_continuous/= := + @initial_continuous _ A X set_val. + move=> svf ctsf; apply/continuous_subspace_setT => x /=. + apply: (continuous_comp (S := subspace A) (g := f)); last exact: ctsf. by move=> U nfU; exact: svf. rewrite continuous_subspace_in => + x Ax U nfxU. move=> /(_ (@exist _ _ x Ax) U) /= []; first exact: nfxU. @@ -78,20 +91,22 @@ apply: filter_app; apply: nearW => w Ww /= /mem_set Aw. by have /= := svWU (@exist _ _ w Aw); rewrite ?set_valE /=; exact. Qed. -Lemma subspace_valL_continuousP' {Y : topologicalType} (y : Y) (f : A -> Y) : +Lemma subspace_valL_continuousP' {d'} {Y : topologicalType d'} + (y : Y) (f : A -> Y) : {within A, continuous (valL_ y f)} <-> continuous f. Proof. rewrite -{2}[f](@valLK _ _ y A); split=> [/subspace_sigL_continuousP//|cf]. exact/subspace_sigL_continuousP. Qed. -Lemma subspace_valL_continuousP {Y : ptopologicalType} (f : A -> Y) : +Lemma subspace_valL_continuousP {d'} {Y : ptopologicalType d'} (f : A -> Y) : {within A, continuous (valL f)} <-> continuous f. -Proof. exact: (@subspace_valL_continuousP' _ point). Qed. +Proof. exact: (@subspace_valL_continuousP' _ _ point). Qed. End subspace_sig. -Lemma within_continuous_comp {U V W : topologicalType} +Lemma within_continuous_comp {d d' d''} + {U : topologicalType d} {V : topologicalType d'} {W : topologicalType d''} (A : set V) (f : V -> U) (g : U -> W) : {in f @` A, continuous g} -> {within A, continuous f} -> @@ -103,7 +118,8 @@ by apply/cg/image_f; rewrite inE; exact/set_valP. Qed. Section subtype_setX. -Context {X Y : topologicalType} (A : set X) (B : set Y). +Context {d d'} {X : topologicalType d} {Y : topologicalType d'}. +Context (A : set X) (B : set Y). Program Definition setX_of_sigT (ab : A `*` B) : (A * B)%type := (@exist _ _ ab.1 _, @exist _ _ ab.2 _). diff --git a/theories/topology_theory/supremum_topology.v b/theories/topology_theory/supremum_topology.v index 0cf35ba159..e079a4b7b6 100644 --- a/theories/topology_theory/supremum_topology.v +++ b/theories/topology_theory/supremum_topology.v @@ -22,31 +22,38 @@ Unset Printing Implicit Defensive. Local Open Scope classical_set_scope. Local Open Scope ring_scope. +Fact supremum_fdisp {I} (d : I -> fdisp_t) : fdisp_t. +Proof. by []. Qed. + +Notation "d .-sup" := (supremum_fdisp d) : fdisp_scope. + Definition sup_topology {T : Type} {I : Type} - (Tc : I -> Topological T) : Type := T. + {d : I -> fdisp_t} (Tc : forall i, Topological (d i) T) : Type := T. Section Sup_Topology. -Variable (T : choiceType) (I : Type) (Tc : I -> Topological T). +Context (T : choiceType) (I : Type) + (d : I -> fdisp_t) (Tc : forall i, Topological (d i) T). Local Notation S := (sup_topology Tc). Let TS := fun i => Topological.Pack (Tc i). -Definition sup_subbase := \bigcup_i (@open (TS i) : set_system T). +Definition sup_subbase := \bigcup_i (@open _ (TS i) : set_system T). HB.instance Definition _ := Choice.on S. -HB.instance Definition _ := isSubBaseTopological.Build S sup_subbase id. +HB.instance Definition _ := + isSubBaseTopological.Build (supremum_fdisp d) S sup_subbase id. Lemma cvg_sup (F : set_system T) (t : T) : Filter F -> F --> (t : S) <-> forall i, F --> (t : TS i). Proof. move=> Ffilt; split=> cvFt. - move=> i A /=; rewrite (@nbhsE (TS i)) => - [B [Bop Bt] sBA]. + move=> i A /=; rewrite (@nbhsE _ (TS i)) => - [B [Bop Bt] sBA]. apply: cvFt; exists B; split=> //; exists [set B]; last first. by rewrite predeqE => ?; split=> [[_ ->]|] //; exists B. move=> _ ->; exists [fset B]%fset. by move=> ?; rewrite inE inE => /eqP->; exists i. by rewrite predeqE=> ?; split=> [|??]; [apply|]; rewrite /= inE // =>/eqP->. -move=> A /=; rewrite (@nbhsE S). +move=> A /=; rewrite (@nbhsE _ S). move=> [_ [[B sB <-] [C BC Ct] sUBA]]. rewrite nbhs_filterE; apply: filterS sUBA _; apply: (@filterS _ _ _ C). by move=> ? ?; exists C. @@ -57,17 +64,19 @@ Qed. End Sup_Topology. -HB.instance Definition _ (I : Type) (T : pointedType) (f : I -> Topological T) := +HB.instance Definition _ (I : Type) (T : pointedType) + (d : I -> fdisp_t) (f : forall i, Topological (d i) T) := Pointed.on (sup_topology f). Section sup_uniform. Local Open Scope relation_scope. -Context {T : choiceType} {Ii : Type} (Tc : Ii -> Uniform T). +Context {T : choiceType} {Ii : Type} {d : Ii -> fdisp_t} + (Tc : forall i : Ii, Uniform (d i) T). Let I : choiceType := {classic Ii}. Let TS := fun i => Uniform.Pack (Tc i). Notation Tt := (sup_topology Tc). -Let ent_of (p : I * set (T * T)) := `[< @entourage (TS p.1) p.2 >]. +Let ent_of (p : I * set (T * T)) := `[< @entourage _ (TS p.1) p.2 >]. Let IEntType := {p : (I * set (T * T)) | ent_of p}. Let IEnt : choiceType := IEntType. @@ -117,7 +126,7 @@ Qed. Local Lemma sup_ent_split A : sup_ent A -> exists2 B, sup_ent B & B \; B `<=` A. Proof. have spt : (forall ie : IEnt, ent_of ((projT1 ie).1, - (@split_ent (TS (projT1 ie).1) (projT1 ie).2))). + (@split_ent _ (TS (projT1 ie).1) (projT1 ie).2))). by case=> [[/= ? ?] /asboolP/entourage_split_ent ?]; exact/asboolP. pose g : (IEnt -> IEnt) := fun x => exist ent_of _ (spt x). case => W [F _ <-] sA; exists (\bigcap_(x in [set` F]) (projT1 (g x)).2). @@ -127,12 +136,12 @@ case => W [F _ <-] sA; exists (\bigcap_(x in [set` F]) (projT1 (g x)).2). by move => ?; apply/(Igxy (g ie))/imfsetP; exists ie. by move=> /imfsetP [?? ->]; exact: Igxy. case => ?? [z Fxz Fzy]; apply: sA; IEntP=> i e ? ? eF. -apply: ((@entourage_split (TS i)) z) => //. +apply: ((@entourage_split _ (TS i)) z) => //. exact: (Fxz _ eF). exact: (Fzy _ eF). Qed. -Local Lemma sup_ent_nbhs : @nbhs Tt Tt = nbhs_ sup_ent. +Local Lemma sup_ent_nbhs : @nbhs _ Tt Tt = nbhs_ sup_ent. Proof. rewrite predeq2E => x V; split. move=> [/= X [[/= B + <-] [W BW Wx BV]]] => /(_ W BW) [] /=. @@ -145,7 +154,7 @@ rewrite predeq2E => x V; split. move=> /= v; apply: cid; case (pselect (v \in F)); first last. by move=> ?; exists (exist ent_of _ (IEnt_pointT i0)). move=> /[dup] /Fx vx /Fsup/set_mem [i _]; rewrite openE => /(_ x vx). - by move=> /(@nbhsP (TS i)) [w /asboolP ent ?]; exists (exist _ (i, w) ent). + by move=> /(@nbhsP _ (TS i)) [w /asboolP ent]; exists (exist _ (i, w) ent). exists (\bigcap_(w in [set` F]) (projT1 (projT1 (f w))).2); first last. move=> v /= /xsectionP Fgw; apply: BV; exists (\bigcap_(i in [set` F]) i) => //. by move=> w /[dup] ? /Fgw /= /mem_set/(projT2 (f w)); exact. @@ -159,7 +168,7 @@ case=> E [D [/= F FsubEnt <-] FsubE EsubV]. have F_nbhs_x : Filter (nbhs x) by typeclasses eauto. apply: (filterS EsubV). pose f : IEnt -> set T := fun w => - @interior (TS (projT1 w).1) (xsection (projT1 w).2 x). + @interior _ (TS (projT1 w).1) (xsection (projT1 w).2 x). exists (\bigcap_(w in [set` F]) f w); repeat split. - exists [set \bigcap_(w in [set` F]) f w]; last by rewrite bigcup_set1. move=> ? ->; exists [fset f w | w in F]%fset. @@ -171,7 +180,7 @@ exists (\bigcap_(w in [set` F]) f w); repeat split. by apply/mem_set/FsubE => it /Ifwt/interior_subset => /set_mem. Qed. -HB.instance Definition _ := @Nbhs_isUniform.Build Tt sup_ent +HB.instance Definition _ := @Nbhs_isUniform.Build (supremum_fdisp d) Tt sup_ent sup_ent_filter sup_ent_refl sup_ent_inv sup_ent_split sup_ent_nbhs. Lemma countable_sup_ent : @@ -201,7 +210,7 @@ exists (open_finI_from (\bigcup_n g n) id); split. case=> [[n w]] p /imfsetP [x /= xA M]; apply: Ia. by rewrite (_ : w = x) // (svalP (h x) xA) -M. - move=> E [w] [ A _ wIA wsubE]. - have ent_Ip (i : IEnt) : @entourage (TS (projT1 i).1) (projT1 i).2. + have ent_Ip (i : IEnt) : @entourage _ (TS (projT1 i).1) (projT1 i).2. by apply/asboolP; exact: (projT2 i). pose h (i : IEnt) : {x : set (T * T) | _} := cid2 (and3_rec (fun _ _ P => P) (projT2 (f (projT1 i).1)) (projT1 i).2 (ent_Ip i)). diff --git a/theories/topology_theory/topology_structure.v b/theories/topology_theory/topology_structure.v index 37a079a424..0f155e8091 100644 --- a/theories/topology_theory/topology_structure.v +++ b/theories/topology_theory/topology_structure.v @@ -130,6 +130,14 @@ Reserved Notation "A °" (format "A °"). Reserved Notation "[ 'locally' P ]" (format "[ 'locally' P ]"). Reserved Notation "x ^'" (format "x ^'"). +Reserved Notation "d .-open" (at level 5, format "d .-open"). +Reserved Notation "d .-interior" (at level 5, format "d .-interior"). +Reserved Notation "d .-open_nbhs" (at level 5, format "d .-open_nbhs"). +Reserved Notation "d .-basis" (at level 5, format "d .-basis"). +Reserved Notation "d .-closure" (at level 5, format "d .-closure"). +Reserved Notation "d .-closed" (at level 5, format "d .-closed"). +Reserved Notation "d .-clopen" (at level 5, format "d .-clopen"). + Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. @@ -138,7 +146,8 @@ Local Open Scope classical_set_scope. Local Open Scope ring_scope. (** Topological spaces *) -HB.mixin Record Nbhs_isTopological (T : Type) & Nbhs T := { +HB.mixin Record Nbhs_isTopological d (T : Type) +& Nbhs d T := { open : set_system T; nbhs_pfilter_subproof : forall p : T, ProperFilter (nbhs p) ; nbhsE_subproof : forall p : T, nbhs p = @@ -147,23 +156,27 @@ HB.mixin Record Nbhs_isTopological (T : Type) & Nbhs T := { }. #[short(type="topologicalType")] -HB.structure Definition Topological := - {T of Nbhs T & Nbhs_isTopological T}. +HB.structure Definition Topological d := + {T of Nbhs d T & Nbhs_isTopological d T}. #[short(type="ptopologicalType")] -HB.structure Definition PointedTopological := - {T of PointedNbhs T & Nbhs_isTopological T}. +HB.structure Definition PointedTopological d := + {T of PointedNbhs d T & Nbhs_isTopological d T}. #[short(type="bpTopologicalType")] -HB.structure Definition BiPointedTopological := - { X of BiPointed X & Topological X }. +HB.structure Definition BiPointedTopological d := + { X of BiPointed X & Topological d X }. #[short(type="subTopologicalType")] -HB.structure Definition SubTopological (V : topologicalType) - (S : pred V) := {U of SubNbhs V S U & Topological U}. +HB.structure Definition SubTopological d d' (V : topologicalType d) + (S : pred V) := {U of @SubNbhs d d' V S U & Topological d' U}. + +HB.instance Definition _ (d d' : fdisp_t) (T : topologicalType d) := + @Nbhs_isTopological.Build d' (with_fdisp d' T) open nbhs_pfilter_subproof nbhsE_subproof openE_subproof. +HB.saturate with_fdisp. Section Topological1. -Context {T : topologicalType}. +Context d {T : topologicalType d}. Definition open_nbhs (p : T) (A : set T) := open A /\ A p. @@ -189,7 +202,7 @@ by rewrite nbhsE propeqE; split=> [[? ?]|[? [B [? ?] BA]]]; split => //; [exists A | exact: BA]. Qed. -Definition interior (A : set T) := (@nbhs _ T)^~ A. +Definition interior (A : set T) := (@nbhs _ _ T)^~ A. Local Notation "A °" := (interior A). @@ -216,7 +229,7 @@ Proof. by rewrite openE. Qed. Lemma openT : open (setT : set T). Proof. by rewrite openE => ??; apply: filterT. Qed. -Lemma openI : setI_closed (@open T). +Lemma openI : setI_closed (@open _ T). Proof. move=> A B; rewrite openE => Aop Bop p [Ap Bp]. by apply: filterI; [apply: Aop|apply: Bop]. @@ -237,7 +250,7 @@ move=> HU; elim; [rewrite bigcap_mkord big_ord0; apply: openT|move=> n IH]. by rewrite bigcap_mkord big_ord_recr -bigcap_mkord; apply: openI. Qed. -Lemma openU : setU_closed (@open T). +Lemma openU : setU_closed (@open _ T). Proof. by move=> A B /[!openE] AA BB p [/AA|/BB]; apply: filterS => ? ?; [left|right]. Qed. @@ -281,7 +294,7 @@ Qed. End Topological1. -Lemma open_in_nearW {T : topologicalType} (P : T -> Prop) (S : set T) : +Lemma open_in_nearW {d} {T : topologicalType d} (P : T -> Prop) (S : set T) : open S -> {in S, forall x, P x} -> {in S, forall x, \forall x0 \near x, P x0}. Proof. by move=> oS SP z /set_mem Sz; apply: in_nearW SP => //=; exact: open_nbhs_nbhs. @@ -292,20 +305,22 @@ Qed. #[global] Hint Extern 0 (ProperFilter (nbhs _)) => solve [apply: nbhs_pfilter] : typeclass_instances. -Global Instance alias_nbhs_filter {T : topologicalType} x : - @Filter T^o (@nbhs T^o T x). +Global Instance alias_nbhs_filter d {T : topologicalType d} x : + @Filter T^o (@nbhs _ T^o T x). Proof. apply: @nbhs_filter T x. Qed. -Global Instance alias_nbhs_pfilter {T : topologicalType} x : - @ProperFilter T^o (@nbhs T^o T x). +Global Instance alias_nbhs_pfilter d {T : topologicalType d} x : + @ProperFilter T^o (@nbhs _ T^o T x). Proof. exact: @nbhs_pfilter T x. Qed. Reserved Notation "A ^°" (at level 1, format "A ^°"). -Notation "A °" := (interior A) : classical_set_scope. +Notation "A °" := (@interior _ _ A) (only parsing) + : classical_set_scope. #[deprecated(since="mathcomp-analysis 1.10.0", note="use the notation instead ° instead of ^°")] Notation "A ^°" := (A°) (only parsing). -Lemma continuousP (S T : topologicalType) (f : S -> T) : +Lemma continuousP d d' (S : topologicalType d) (T : topologicalType d') + (f : S -> T) : continuous f <-> forall A, open A -> open (f @^-1` A). Proof. split=> fcont; first by rewrite !openE => A Aop ? /Aop /fcont. @@ -313,23 +328,24 @@ move=> s A; rewrite nbhs_simpl /= !nbhsE => - [B [Bop Bfs] sBA]. by exists (f @^-1` B); [split=> //; apply/fcont|move=> ? /sBA]. Qed. -Lemma open_comp {T U : topologicalType} (f : T -> U) (D : set U) : +Lemma open_comp {d d'} {T : topologicalType d'} {U : topologicalType d} + (f : T -> U) (D : set U) : {in f @^-1` D, continuous f} -> open D -> open (f @^-1` D). Proof. rewrite !openE => fcont Dop x /= Dfx. by apply: fcont; [rewrite inE|exact: Dop]. Qed. -Lemma cvg_fmap {T : topologicalType} {U : topologicalType} +Lemma cvg_fmap d d' {T: topologicalType d} {U : topologicalType d'} (F : set_system T) x (f : T -> U) : {for x, continuous f} -> F --> x -> f @ F --> f x. Proof. by move=> cf fx P /cf /fx. Qed. -Lemma near_join (T : topologicalType) (x : T) (P : set T) : +Lemma near_join d (T : topologicalType d) (x : T) (P : set T) : (\forall x0 \near x, P x0) -> \forall x0 \near x, \forall x1 \near x0, P x1. Proof. exact: nbhs_interior. Qed. -Lemma near_bind (T : topologicalType) (P Q : set T) (x : T) : +Lemma near_bind d (T : topologicalType d) (P Q : set T) (x : T) : (\forall x0 \near x, (\forall x1 \near x, P x1) -> Q x0) -> (\forall x0 \near x, P x0) -> \forall x0 \near x, Q x0. @@ -340,8 +356,8 @@ Unshelve. all: by end_near. Qed. (* limit composition *) -Lemma continuous_cvg {T : Type} {V U : topologicalType} - (F : set_system T) (FF : Filter F) +Lemma continuous_cvg {T : Type} d d' {V : topologicalType d} + {U : topologicalType d'} (F : set_system T) (FF : Filter F) (f : T -> V) (h : V -> U) (a : V) : {for a, continuous h} -> f @ F --> a -> (h \o f) @ F --> h a. @@ -350,7 +366,8 @@ move=> h_continuous fa fb; apply: (cvg_trans _ h_continuous). exact: (cvg_comp _ h fa). Qed. -Lemma continuous_is_cvg {T : Type} {V U : ptopologicalType} [F : set_system T] +Lemma continuous_is_cvg {T : Type} d d' + {V : ptopologicalType d} {U : ptopologicalType d'} [F : set_system T] (FF : Filter F) (f : T -> V) (h : V -> U) : (forall l, f x @[x --> F] --> l -> {for l, continuous h}) -> cvg (f x @[x --> F]) -> cvg ((h \o f) x @[x --> F]). @@ -359,8 +376,9 @@ move=> ach /cvg_ex[l fxl]; apply/cvg_ex; exists (h l). by apply: continuous_cvg => //; exact: ach. Qed. -Lemma continuous2_cvg {T : Type} {V W U : topologicalType} - (F : set_system T) (FF : Filter F) +Lemma continuous2_cvg {d d' d''} {T : Type} + {V : topologicalType d} {W : topologicalType d'} + {U : topologicalType d''} (F : set_system T) (FF : Filter F) (f : T -> V) (g : T -> W) (h : V -> W -> U) (a : V) (b : W) : h z.1 z.2 @[z --> (a, b)] --> h a b -> f @ F --> a -> g @ F --> b -> (fun x => h (f x) (g x)) @ F --> h a b. @@ -369,8 +387,9 @@ move=> h_continuous fa fb; apply: (cvg_trans _ h_continuous). exact: (cvg_comp _ (fun x => h x.1 x.2) (cvg_pair fa fb)). Qed. -Lemma continuous_comp_cvg {T V U : topologicalType} - (f : T -> V) (h : V -> U) (r : T) (l : U) : +Lemma continuous_comp_cvg {d d' d''} + {T : topologicalType d} {V : topologicalType d'} + {U : topologicalType d''} (f : T -> V) (h : V -> U) (r : T) (l : U) : {for f r, continuous h} -> (h \o f) x @[x --> r] --> l -> h x @[x --> f r] --> l. Proof. @@ -381,54 +400,56 @@ have /hfrl : nbhs l Y by exact: open_nbhs_nbhs. by rewrite nbhsE => -[W [oW Wr]]; exact. Qed. -Lemma cvg_near_cst (T : Type) (U : topologicalType) +Lemma cvg_near_cst {d} (T : Type) (U : topologicalType d) (l : U) (f : T -> U) (F : set_system T) {FF : Filter F} : (\forall x \near F, f x = l) -> f @ F --> l. Proof. move=> fFl P /=; rewrite !near_simpl => Pl. by apply: filterS fFl => _ ->; exact: nbhs_singleton. Qed. -Arguments cvg_near_cst {T U} l {f F FF}. +Arguments cvg_near_cst {d T U} l {f F FF}. -Lemma is_cvg_near_cst (T : Type) (U : ptopologicalType) +Lemma is_cvg_near_cst {d} (T : Type) (U : ptopologicalType d) (l : U) (f : T -> U) (F : set_system T) {FF : Filter F} : (\forall x \near F, f x = l) -> cvg (f @ F). Proof. by move=> /cvg_near_cst/cvgP. Qed. -Arguments is_cvg_near_cst {T U} l {f F FF}. +Arguments is_cvg_near_cst {d T U} l {f F FF}. -Lemma near_cst_continuous (T U : topologicalType) +Lemma near_cst_continuous {d d'} + (T : topologicalType d) (U : topologicalType d') (l : U) (f : T -> U) (x : T) : (\forall y \near x, f y = l) -> {for x, continuous f}. Proof. move=> eq_f_l; apply: cvg_near_cst; apply: filterS (eq_f_l) => y ->. by rewrite (nbhs_singleton eq_f_l). Qed. -Arguments near_cst_continuous {T U} l [f x]. +Arguments near_cst_continuous {d d' T U} l [f x]. -Lemma cvg_cst (U : topologicalType) (x : U) (T : Type) +Lemma cvg_cst d (U : topologicalType d) (x : U) (T : Type) (F : set_system T) {FF : Filter F} : (fun _ : T => x) @ F --> x. Proof. by apply: cvg_near_cst; near=> x0. Unshelve. all: by end_near. Qed. -Arguments cvg_cst {U} x {T F FF}. +Arguments cvg_cst {d U} x {T F FF}. #[global] Hint Extern 0 (_ @ _ --> _) => solve [apply: cvg_cst] : core. -Lemma is_cvg_cst (U : ptopologicalType) (x : U) (T : Type) +Lemma is_cvg_cst d (U : ptopologicalType d) (x : U) (T : Type) (F : set_system T) {FF : Filter F} : cvg ((fun _ : T => x) @ F). Proof. exact: cvgP (cvg_cst _). Qed. -Arguments is_cvg_cst {U} x {T F FF}. +Arguments is_cvg_cst {d U} x {T F FF}. #[global] Hint Extern 0 (cvg (_ @ _)) => solve [apply: is_cvg_cst] : core. #[global] Hint Extern 0 (cvgn (_ @ _)) => solve [apply: is_cvg_cst] : core. -Lemma cst_continuous {T U : topologicalType} (x : U) : +Lemma cst_continuous {d d'} + {T : topologicalType d} {U : topologicalType d'} (x : U) : continuous (fun _ : T => x). Proof. by move=> t; exact: cvg_cst. Qed. -Lemma id_continuous {T : topologicalType} : continuous (@id T). +Lemma id_continuous {d} {T : topologicalType d} : continuous (@id T). Proof. by move=> t; exact: cvg_id. Qed. Section within_topologicalType. -Context {T : topologicalType} (A : set T). +Context {d} {T : topologicalType d} (A : set T). Implicit Types B : set T. (* Relation between globally and within A (nbhs x) *) @@ -472,7 +493,8 @@ move=> [V FV AU]; rewrite /within /prop_near1 nbhs_simpl/=; near=> w => Aw. by have []// : (U `&` A) w; rewrite AU; split => //; apply: (near FV). Unshelve. all: by end_near. Qed. -Lemma fmap_within_eq {S : topologicalType} (F : set_system T) (f g : T -> S) : +Lemma fmap_within_eq {d'} {S : topologicalType d'} + (F : set_system T) (f g : T -> S) : Filter F -> {in A, f =1 g} -> f @ within A F --> g @ within A F. Proof. move=> FF feq U /=; near_simpl; apply: filter_app. @@ -482,17 +504,17 @@ Unshelve. all: by end_near. Qed. End within_topologicalType. -Notation "[ 'locally' P ]" := (@locally_of _ _ _ (Phantom _ P)). +Notation "[ 'locally' P ]" := (@locally_of _ _ _ _ (Phantom _ P)). (** Topology defined by a filter *) -HB.factory Record Nbhs_isNbhsTopological T & Nbhs T := { +HB.factory Record Nbhs_isNbhsTopological d T & Nbhs d T := { nbhs_filter : forall p : T, ProperFilter (nbhs p); nbhs_singleton : forall (p : T) (A : set T), nbhs p A -> A p; nbhs_nbhs : forall (p : T) (A : set T), nbhs p A -> nbhs p (nbhs^~ A); }. -HB.builders Context T & Nbhs_isNbhsTopological T. +HB.builders Context d T & Nbhs_isNbhsTopological d T. Definition open_of_nbhs := [set A : set T | A `<=` nbhs^~ A]. @@ -509,7 +531,7 @@ Qed. Let openE_subproof : open_of_nbhs = [set A : set T | A `<=` nbhs^~ A]. Proof. by []. Qed. -HB.instance Definition _ := Nbhs_isTopological.Build T +HB.instance Definition _ := Nbhs_isTopological.Build d T nbhs_filter nbhsE_subproof openE_subproof. HB.end. @@ -519,7 +541,7 @@ HB.end. Definition nbhs_of_open (T : Type) (op : set_system T) (p : T) (A : set T) := exists B, [/\ op B, B p & B `<=` A]. -HB.factory Record isOpenTopological T & Choice T := { +HB.factory Record isOpenTopological (d : fdisp_t) T & Choice T := { op : set_system T ; opT : op setT ; opI : setI_closed op ; @@ -527,9 +549,9 @@ HB.factory Record isOpenTopological T & Choice T := { op (\bigcup_i f i) }. -HB.builders Context T & isOpenTopological T. +HB.builders Context d T & isOpenTopological d T. -HB.instance Definition _ := hasNbhs.Build T (nbhs_of_open op). +HB.instance Definition _ := hasNbhs.Build d T (nbhs_of_open op). Let nbhs_pfilter_subproof (p : T) : ProperFilter (nbhs p). Proof. @@ -557,7 +579,7 @@ rewrite predeqE => p; split=> [|[B _ Bp]]; last by have [_] := projT2 B; apply. by move=> /Aop [B [Bop Bp sBA]]; exists (existT _ B (conj Bop sBA)). Qed. -HB.instance Definition _ := Nbhs_isTopological.Build T +HB.instance Definition _ := Nbhs_isTopological.Build d T nbhs_pfilter_subproof nbhsE_subproof openE_subproof. HB.end. @@ -571,7 +593,7 @@ Notation open_from := openU_from (only parsing). (** Topology defined by a base of open sets *) -HB.factory Record isBaseTopological T & Choice T := { +HB.factory Record isBaseTopological (d : fdisp_t) T & Choice T := { I : pointedType ; D : set I ; b : I -> set T ; @@ -580,7 +602,7 @@ HB.factory Record isBaseTopological T & Choice T := { exists k, [/\ D k, b k t & b k `<=` b i `&` b j] }. -HB.builders Context T & isBaseTopological T. +HB.builders Context d T & isBaseTopological d T. Local Notation openU_from := (openU_from D b). @@ -624,19 +646,19 @@ have /getPex [_ ->] : exists Dj, fop j Dj by have [Dj] := H j; exists Dj. by move=> [i]; exists i => //; exists j. Qed. -HB.instance Definition _ := isOpenTopological.Build T +HB.instance Definition _ := isOpenTopological.Build d T openU_fromT openU_fromI openU_from_bigU. HB.end. -HB.factory Record isSubBaseTopological T & Choice T := { +HB.factory Record isSubBaseTopological (d : fdisp_t) T & Choice T := { I : pointedType ; D : set I ; b : I -> set T }. -HB.builders Context T & isSubBaseTopological T. +HB.builders Context d T & isSubBaseTopological d T. Local Notation finI_from := (open_finI_from D b). @@ -659,28 +681,28 @@ by move=> [DAi|DBi]; [have := As; rewrite -AeIbA; apply|have := Bs; rewrite -BeIbB; apply]. Qed. -HB.instance Definition _ := isBaseTopological.Build T +HB.instance Definition _ := isBaseTopological.Build d T finI_from_cover finI_from_join. HB.end. (** deleted neighborhood *) -Definition dnbhs {T : topologicalType} (x : T) := +Definition dnbhs {d} {T : topologicalType d} (x : T) := within (fun y => y != x) (nbhs x). Notation "x ^'" := (dnbhs x) : classical_set_scope. -Lemma nbhs_dnbhs_neq {T : topologicalType} (p : T) : +Lemma nbhs_dnbhs_neq {d} {T : topologicalType d} (p : T) : \forall x \near nbhs p^', x != p. Proof. exact: withinT. Qed. #[global] Hint Extern 0 (\forall x \near nbhs _^', is_true (x != _)) => solve [apply: nbhs_dnbhs_neq] : core. -Lemma nbhs_dnbhs {T : topologicalType} (x : T) : x^' `=>` nbhs x. +Lemma nbhs_dnbhs {d} {T : topologicalType d} (x : T) : x^' `=>` nbhs x. Proof. exact: cvg_within. Qed. -Lemma dnbhsE (T : topologicalType) (x : T) : +Lemma dnbhsE d (T : topologicalType d) (x : T) : nbhs x = x^' `&` principal_filter x. Proof. rewrite predeqE => A; split=> [x_A|[+ Ax]]. @@ -689,11 +711,11 @@ rewrite /dnbhs !nbhsE => -[B [oB x_B sBA]]; exists B => //. by move=> y /sBA Ay; case: (eqVneq y x) => [->|//]; exact/principal_filterP. Qed. -Global Instance dnbhs_filter {T : topologicalType} (x : T) : Filter x^'. +Global Instance dnbhs_filter {d} {T : topologicalType d} (x : T) : Filter x^'. Proof. exact: within_filter. Qed. #[global] Typeclasses Opaque dnbhs. -Canonical dnbhs_filter_on (T : topologicalType) (x : T) := +Canonical dnbhs_filter_on {d} (T : topologicalType d) (x : T) := FilterType x^' (dnbhs_filter _). Lemma cvg_fmap2 (T U : Type) (f : T -> U): @@ -704,28 +726,29 @@ Lemma cvg_within_filter {T U} {f : T -> U} (F : set_system T) {FF : (Filter F) } (G : set_system U) (D : set T) : (f @ F) --> G -> (f @ within D F) --> G. Proof. exact: cvg_trans (cvg_fmap2 (cvg_within _)). Qed. -Lemma cvg_app_within {T} {U : ptopologicalType} (f : T -> U) (F : set_system T) - (D : set T): Filter F -> cvg (f @ F) -> cvg (f @ within D F). +Lemma cvg_app_within {d} {T} {U : ptopologicalType d} + (f : T -> U) (F : set_system T) (D : set T) : + Filter F -> cvg (f @ F) -> cvg (f @ within D F). Proof. by move => FF /cvg_ex [l H]; apply/cvg_ex; exists l; exact: cvg_within_filter. Qed. (** meets *) -Lemma meets_openr {T : topologicalType} (F : set_system T) (x : T) : +Lemma meets_openr {d} {T : topologicalType d} (F : set_system T) (x : T) : F `#` nbhs x = F `#` open_nbhs x. Proof. rewrite propeqE; split; [exact/meetsSr/open_nbhs_nbhs|]. by move=> P A B {}/P P; rewrite nbhsE => -[B' /P + sB]; apply: subsetI_neq0. Qed. -Lemma meets_openl {T : topologicalType} (F : set_system T) (x : T) : +Lemma meets_openl {d} {T : topologicalType d} (F : set_system T) (x : T) : nbhs x `#` F = open_nbhs x `#` F. Proof. by rewrite meetsC meets_openr meetsC. Qed. (** Closed sets in topological spaces *) Section Closed. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Definition closure (A : set T) := [set p : T | forall B, nbhs p B -> A `&` B !=set0]. @@ -867,7 +890,8 @@ End Closed. #[deprecated(since="mathcomp-analysis 1.15.0", note="use `closure_isolated_limit_point` instead")] Notation closure_limit_point := __deprecated__closure_limit_point (only parsing). -Lemma preimage_closed {T U : topologicalType} (f : T -> U) (D : set U) : +Lemma preimage_closed {d d'} {T : topologicalType d} {U : topologicalType d'} + (f : T -> U) (D : set U) : {in ~` f @^-1` D, continuous f} -> closed D -> closed (f @^-1` D). Proof. rewrite !closedE => f_continuous D_cl x /= xDf. @@ -879,7 +903,7 @@ Qed. #[deprecated(since="mathcomp-analysis 1.16.0", note="renamed to `preimage_closed`")] Notation closed_comp := preimage_closed (only parsing). -Lemma closed_cvg {T} {V : topologicalType} {F} {FF : ProperFilter F} +Lemma closed_cvg {d T} {V : topologicalType d} {F} {FF : ProperFilter F} (u_ : T -> V) (A : V -> Prop) : (* BUG: elim does not see this as an elimination principle if A : set V *) closed A -> (\forall n \near F, A (u_ n)) -> @@ -888,9 +912,10 @@ Proof. move=> + FAu_ l u_Fl; apply => B /u_Fl /=; rewrite nbhs_filterE. by move=> /(filterI FAu_) => /filter_ex[t [Au_t u_Bt]]; exists (u_ t). Qed. -Arguments closed_cvg {T V F FF u_} _ _ _ _ _. +Arguments closed_cvg {d T V F FF u_} _ _ _ _ _. -Lemma continuous_closedP (S T : topologicalType) (f : S -> T) : +Lemma continuous_closedP d d' + (S : topologicalType d) (T : topologicalType d') (f : S -> T) : continuous f <-> forall A, closed A -> closed (f @^-1` A). Proof. rewrite continuousP; split=> ctsf ? ?. @@ -898,10 +923,10 @@ rewrite continuousP; split=> ctsf ? ?. by rewrite -closedC preimage_setC; apply: ctsf; rewrite closedC. Qed. -Lemma closedU (T : topologicalType) : setU_closed (@closed T). +Lemma closedU d (T : topologicalType d) : setU_closed (@closed _ T). Proof. by move=> E D; rewrite -?openC setCU; exact: openI. Qed. -Lemma bigsetU_closed {T : topologicalType} {I : eqType} (s : seq I) +Lemma bigsetU_closed {d} {T : topologicalType d} {I : eqType} (s : seq I) (F : I -> set T) : (forall x, x \in s -> closed (F x)) -> closed (\big[setU/set0]_(x <- s) F x). Proof. @@ -911,7 +936,7 @@ Qed. #[deprecated(since="mathcomp-analysis 1.17.0", use=bigsetU_closed)] Notation closed_bigsetU := bigsetU_closed (only parsing). -Lemma bigcup_closed {T : topologicalType} {I : choiceType} (A : set I) +Lemma bigcup_closed {d} {T : topologicalType d} {I : choiceType} (A : set I) (F : I -> set T) : finite_set A -> (forall i, A i -> closed (F i)) -> closed (\bigcup_(i in A) F i). @@ -923,7 +948,7 @@ Qed. Notation closed_bigcup := bigcup_closed (only parsing). Section closure_lemmas. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Implicit Types E A B U : set T. Lemma closureS A B : A `<=` B -> closure A `<=` closure B. @@ -948,7 +973,7 @@ Qed. End closure_lemmas. Section regular_open_closed. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Definition regopen (A : set T) := (closure A)° = A. @@ -957,7 +982,7 @@ Definition regclosed (A : set T) := closure (A°) = A. End regular_open_closed. Section closure_interior_lemmas. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Implicit Types (A B : set T). Lemma interiorC A : (~` A)° = ~` closure A. @@ -1076,23 +1101,25 @@ rewrite /regclosed -(setCK A) openC => cCA. by rewrite closureC -[in RHS]interior_closed_regopen// !(closureC, interiorC). Qed. -Lemma interior_closure_idem : @idempotent_fun (set T) (interior \o closure). +Lemma interior_closure_idem : + @idempotent_fun (set T) (@interior _ _ \o @closure _ _). Proof. move=> ?; exact/interior_closed_regopen/closed_closure. Qed. -Lemma closure_interior_idem : @idempotent_fun (set T) (closure \o interior). +Lemma closure_interior_idem : + @idempotent_fun (set T) (@closure _ _ \o @interior _ _). Proof. move=> ?; exact/closure_open_regclosed/open_interior. Qed. End closure_interior_lemmas. #[deprecated(since="mathcomp-analysis 1.17.0", note="renamed to `closureC`")] Notation closure_setC := closureC (only parsing). -Arguments closureEbigcap_itvcc {T A}. -Arguments interiorEbigcup_itvcc {T A}. +Arguments closureEbigcap_itvcc {d T A}. +Arguments interiorEbigcup_itvcc {d T A}. -Definition dense (T : topologicalType) (S : set T) := +Definition dense d (T : topologicalType d) (S : set T) := forall (O : set T), O !=set0 -> open O -> O `&` S !=set0. -Lemma denseNE (T : topologicalType) (S : set T) : ~ dense S -> +Lemma denseNE d (T : topologicalType d) (S : set T) : ~ dense S -> exists O, (exists x, open_nbhs x O) /\ (O `&` S = set0). Proof. rewrite /dense /open_nbhs. @@ -1100,7 +1127,7 @@ move=> /existsNP[X /not_implyP[[x Xx] /not_implyP[ Ox /forallNP A]]]. by exists X; split; [exists x | rewrite -subset0; apply/A]. Qed. -Lemma denseI (T : topologicalType) (A B : set T) : +Lemma denseI d (T : topologicalType d) (A B : set T) : open A -> dense A -> dense B -> dense (A `&` B). Proof. move=> oA dA dB C C0 oC. @@ -1109,7 +1136,7 @@ suff: (C `&` A) `&` B !=set0 by rewrite setIA. by apply: dB => //; exact: openI. Qed. -Lemma dense0 {R : ptopologicalType} : ~ dense (@set0 R). +Lemma dense0 {d} {R : ptopologicalType d} : ~ dense (@set0 R). Proof. apply/existsNP; exists setT. apply/not_implyP; split; first exact/set0P/setT0. @@ -1118,7 +1145,7 @@ by rewrite setTI => -[]. Qed. Section basis. -Context {T : topologicalType}. +Context {d} {T : topologicalType d}. Definition basis (B : set_system T) := B `<=` open /\ forall x : T, filter_from [set U | B U /\ U x] id --> x. @@ -1199,26 +1226,29 @@ Qed. End basis. Section ClopenSets. -Implicit Type T : topologicalType. +Implicit Types (d : fdisp_t). -Definition clopen {T} (A : set T) := open A /\ closed A. +Definition clopen {d} {T : topologicalType d} (A : set T) := open A /\ closed A. -Lemma clopenI {T} : setI_closed (@clopen T). +Lemma clopenI {d} {T : topologicalType d} : setI_closed (@clopen d T). Proof. by move=> ? ? [] ? ? [] ? ?; split; [exact: openI|exact: closedI]. Qed. -Lemma clopenU {T} : setU_closed (@clopen T). +Lemma clopenU {d} {T : topologicalType d} : setU_closed (@clopen d T). Proof. by move=> ? ? [] ? ? [] ? ?; split; [exact: openU|exact: closedU]. Qed. -Lemma clopenC {T} (A B : set T) : clopen A -> clopen (~`A). +Lemma clopenC {d} {T : topologicalType d} (A B : set T) : + clopen A -> clopen (~`A). Proof. by case=> ? ?; split;[exact: closed_openC | exact: open_closedC ]. Qed. -Lemma clopen0 {T} : @clopen T set0. +Lemma clopen0 {d} {T : topologicalType d} : @clopen d T set0. Proof. by split; [exact: open0 | exact: closed0]. Qed. -Lemma clopenT {T} : clopen [set: T]. +Lemma clopenT {d} {T : topologicalType d} : clopen [set: T]. Proof. by split; [exact: openT | exact: closedT]. Qed. -Lemma preimage_clopen {T U : topologicalType} (f : T -> U) (A : set U) : +Lemma preimage_clopen + {d d'} {T : topologicalType d} {U : topologicalType d'} + (f : T -> U) (A : set U) : clopen A -> continuous f -> clopen (f @^-1` A). Proof. by case=> ? ?; split; [ exact: open_comp | exact: preimage_closed]. Qed. @@ -1226,25 +1256,29 @@ End ClopenSets. #[deprecated(since="mathcomp-analysis 1.16.0", note="renamed to `preimage_clopen`")] Notation clopen_comp := preimage_clopen (only parsing). -HB.mixin Record isContinuous {X Y : nbhsType} (f : X -> Y):= { +HB.mixin Record isContinuous {d d'} {X : nbhsType d} {Y : nbhsType d'} + (f : X -> Y) := { continuous_fun : continuous f }. #[short(type = "continuousType")] -HB.structure Definition Continuous {X Y : nbhsType} := { - f of @isContinuous X Y f +HB.structure Definition Continuous {d d'} {X : nbhsType d} {Y : nbhsType d'} := { + f of @isContinuous d d' X Y f }. #[deprecated(since="mathcomp-analysis 1.17.0", note="use `continuous_fun` instead")] Notation cts_fun := (continuous_fun) (only parsing). -HB.instance Definition _ {X Y : topologicalType} := +HB.instance Definition _ {d d'} + {X : topologicalType d} {Y : topologicalType d'} := gen_eqMixin (continuousType X Y). -HB.instance Definition _ {X Y : topologicalType} := +HB.instance Definition _ {d d'} + {X : topologicalType d} {Y : topologicalType d'} := gen_choiceMixin (continuousType X Y). -Lemma continuousEP {X Y : nbhsType} (f g : continuousType X Y) : +Lemma continuousEP {d d'} {X : nbhsType d} {Y : nbhsType d'} + (f g : continuousType X Y) : f = g <-> f =1 g. Proof. case: f g => [f [[ffun]]] [g [[gfun]]]/=; split=> [[->//]|/funext eqfg]. @@ -1254,35 +1288,66 @@ rewrite eqfg in ffun *; congr {| Continuous.sort := _; Continuous.class := {| exact: Prop_irrelevance. Qed. -Definition mkcts {X Y : nbhsType} (f : X -> Y) (f_cts : continuous f) := f. +Definition mkcts {d d'} {X : nbhsType d} {Y : nbhsType d'} + (f : X -> Y) (f_cts : continuous f) := f. -HB.instance Definition _ {X Y : nbhsType} (f: X -> Y) (f_cts : continuous f) := - @isContinuous.Build X Y (mkcts f_cts) f_cts. +HB.instance Definition _ {d d'} {X : nbhsType d} {Y : nbhsType d'} + (f: X -> Y) (f_cts : continuous f) := + @isContinuous.Build d d' X Y (mkcts f_cts) f_cts. Section continuous_comp. -Context {X Y Z : topologicalType} +Context {d d' d''} + {X : topologicalType d} {Y : topologicalType d'} {Z : topologicalType d''} (f : continuousType X Y) (g : continuousType Y Z). #[local] Lemma cts_fun_comp : continuous (g \o f). Proof. move=> x; apply: continuous_comp; exact: continuous_fun. Qed. -HB.instance Definition _ := @isContinuous.Build X Z (g \o f) cts_fun_comp. +HB.instance Definition _ := @isContinuous.Build d d'' X Z (g \o f) cts_fun_comp. End continuous_comp. Section continuous_id. -Context {X : topologicalType}. +Context {d} {X : topologicalType d}. -HB.instance Definition _ := @isContinuous.Build X X (@idfun X) id_continuous. +HB.instance Definition _ := + @isContinuous.Build d d X X (@idfun X) id_continuous. End continuous_id. Section continuous_const. -Context {X Y : topologicalType} (y : Y). +Context {d d'} {X : topologicalType d} {Y : topologicalType d'} (y : Y). #[local] Lemma cts_const : continuous (@cst X Y y). Proof. by move=> x; exact: cvg_cst. Qed. -HB.instance Definition _ := @isContinuous.Build X Y (cst y) cts_const. +HB.instance Definition _ := @isContinuous.Build d d' X Y (cst y) cts_const. End continuous_const. + +Module ExplicitNbhsDisplays. +Export filter.ExplicitNbhsDisplays. + +Notation "d .-open" := (@open d _). +Notation "'open'" := (@open default_fdisp _) (only printing). + +Notation "d .-interior" := (@interior d _). +Notation "A °" := (@interior default_fdisp _ A) (only printing) + : classical_set_scope. + +Notation "d .-open_nbhs" := (@open_nbhs d _). +Notation "'open_nbhs'" := (@open_nbhs default_fdisp _) (only printing). + +Notation "d .-basis" := (@basis d _). +Notation "'basis'" := (@basis default_fdisp _) (only printing). + +Notation "d .-closure" := (@closure d _). +Notation "'closure'" := (@closure default_fdisp _) (only printing). + +Notation "d .-closed" := (@closed d _). +Notation "'closed'" := (@closed default_fdisp _) (only printing). + +Notation "d .-clopen" := (@clopen d _). +Notation "'clopen'" := (@clopen default_fdisp _) (only printing). + +End ExplicitNbhsDisplays. \ No newline at end of file diff --git a/theories/topology_theory/uniform_structure.v b/theories/topology_theory/uniform_structure.v index ce77dcc5ea..eb3c32f897 100644 --- a/theories/topology_theory/uniform_structure.v +++ b/theories/topology_theory/uniform_structure.v @@ -44,6 +44,8 @@ From mathcomp Require Import topology_structure. (* ``` *) (******************************************************************************) +Reserved Notation "d .-entourage" (at level 5, format "d .-entourage"). + Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. @@ -60,7 +62,7 @@ Proof. by []. Qed. Local Open Scope relation_scope. -HB.mixin Record Nbhs_isUniform_mixin M & Nbhs M := { +HB.mixin Record Nbhs_isUniform_mixin d M & Nbhs d M := { entourage : set_system (M * M); entourage_filter : Filter entourage; entourage_diagonal_subproof : @@ -72,14 +74,20 @@ HB.mixin Record Nbhs_isUniform_mixin M & Nbhs M := { }. #[short(type="uniformType")] -HB.structure Definition Uniform := - {T of Topological T & Nbhs_isUniform_mixin T}. +HB.structure Definition Uniform d := + {T of Topological d T & Nbhs_isUniform_mixin d T}. #[short(type="puniformType")] -HB.structure Definition PointedUniform := - {T of PointedTopological T & Nbhs_isUniform_mixin T}. +HB.structure Definition PointedUniform d := + {T of PointedTopological d T & Nbhs_isUniform_mixin d T}. + +HB.instance Definition _ (d d' : fdisp_t) (T : uniformType d) := + Nbhs_isUniform_mixin.Build d' (with_fdisp d' T) + entourage_filter entourage_diagonal_subproof entourage_inv_subproof + entourage_split_ex_subproof nbhsE_subproof. +HB.saturate with_fdisp. -HB.factory Record Nbhs_isUniform M & Nbhs M := { +HB.factory Record Nbhs_isUniform d M & Nbhs d M := { entourage : set_system (M * M); entourage_filter : Filter entourage; entourage_diagonal : forall A, entourage A -> diagonal `<=` A; @@ -91,7 +99,7 @@ HB.factory Record Nbhs_isUniform M & Nbhs M := { Local Close Scope relation_scope. -HB.builders Context M & Nbhs_isUniform M. +HB.builders Context d M & Nbhs_isUniform d M. Let nbhs_filter (p : M) : ProperFilter (nbhs p). Proof. @@ -117,17 +125,17 @@ exists C => // q Cpq; rewrite nbhs_E; exists C => // r Cqr. by apply/sBpA/mem_set/sC2B; exists q; exact/set_mem. Qed. -HB.instance Definition _ := Nbhs_isNbhsTopological.Build M +HB.instance Definition _ := Nbhs_isNbhsTopological.Build d M nbhs_filter nbhs_singleton nbhs_nbhs. -HB.instance Definition _ := Nbhs_isUniform_mixin.Build M +HB.instance Definition _ := Nbhs_isUniform_mixin.Build d M entourage_filter entourage_diagonal entourage_inv entourage_split_ex nbhsE. HB.end. Local Open Scope relation_scope. -HB.factory Record isUniform M & Choice M := { +HB.factory Record isUniform (d : fdisp_t) M & Choice M := { entourage : set_system (M * M); entourage_filter : Filter entourage; entourage_diagonal : forall A, entourage A -> diagonal `<=` A; @@ -138,24 +146,24 @@ HB.factory Record isUniform M & Choice M := { Local Close Scope relation_scope. -HB.builders Context M & isUniform M. +HB.builders Context d M & isUniform d M. -HB.instance Definition _ := @hasNbhs.Build M (nbhs_ entourage). +HB.instance Definition _ := @hasNbhs.Build d M (nbhs_ entourage). -HB.instance Definition _ := @Nbhs_isUniform.Build M entourage +HB.instance Definition _ := @Nbhs_isUniform.Build d M entourage entourage_filter entourage_diagonal entourage_inv entourage_split_ex erefl. HB.end. -Lemma nbhs_entourageE {M : uniformType} : nbhs_ (@entourage M) = nbhs. +Lemma nbhs_entourageE {d} {M : uniformType d} : nbhs_ (@entourage d M) = nbhs. Proof. by rewrite -Nbhs_isUniform_mixin.nbhsE_subproof. Qed. Lemma entourage_sym {X Y : Type} E (x : X) (y : Y) : E (x, y) <-> (E ^-1)%relation (y, x). Proof. by []. Qed. -Lemma filter_from_entourageE {M : uniformType} x : - filter_from (@entourage M) (fun A => xsection A x) = nbhs x. +Lemma filter_from_entourageE {d} {M : uniformType d} x : + filter_from (@entourage d M) (fun A => xsection A x) = nbhs x. Proof. by rewrite -nbhs_entourageE. Qed. Module Export NbhsEntourage. @@ -163,7 +171,8 @@ Definition nbhs_simpl := (nbhs_simpl,@filter_from_entourageE,@nbhs_entourageE). End NbhsEntourage. -Lemma nbhsP {M : uniformType} (x : M) P : nbhs x P <-> nbhs_ entourage x P. +Lemma nbhsP {d} {M : uniformType d} (x : M) P : + nbhs x P <-> nbhs_ entourage x P. Proof. by rewrite nbhs_simpl. Qed. Lemma filter_inv {T : Type} (F : set_system (T * T)) : @@ -179,12 +188,12 @@ Qed. Section uniformType1. Local Open Scope relation_scope. -Context {M : uniformType}. +Context {d} {M : uniformType d}. Lemma entourage_refl (A : set (M * M)) x : entourage A -> A (x, x). Proof. by move=> entA; exact: entourage_diagonal_subproof entA _ _. Qed. -Global Instance entourage_filter' : Filter (@entourage M). +Global Instance entourage_filter' : Filter (@entourage d M). Proof. exact: entourage_filter. Qed. @@ -248,8 +257,11 @@ Qed. End uniformType1. -Global Instance entourage_pfilter {M : puniformType} : - ProperFilter (@entourage M). +Notation "d .-split_ent" := (@split_ent d _) (format "d .-split_ent"). +Notation "'split_ent'" := (@split_ent default_fdisp _) (only printing). + +Global Instance entourage_pfilter {d} {M : puniformType d} : + ProperFilter (@entourage d M). Proof. apply Build_ProperFilter_ex; last exact: entourage_filter. by move=> A entA; exists (point, point); apply: entourage_refl. @@ -261,11 +273,11 @@ Hint Extern 0 (entourage (split_ent _)) => exact: entourage_split_ent : core. Hint Extern 0 (entourage (get _)) => exact: entourage_split_ent : core. #[global] Hint Extern 0 (entourage (_^-1)%relation) => exact: entourage_inv : core. -Arguments entourage_split {M} z {x y A}. +Arguments entourage_split {d M} z {x y A}. #[global] Hint Extern 0 (nbhs _ (xsection _ _)) => exact: nbhs_entourage : core. -Lemma ent_closure {M : uniformType} (x : M) E : entourage E -> +Lemma ent_closure {d} {M : uniformType d} (x : M) E : entourage E -> closure (xsection (split_ent E) x) `<=` xsection E x. Proof. pose E' := (split_ent E) `&` (split_ent E)^-1%relation. @@ -275,7 +287,8 @@ move=> y; rewrite xsectionI => -[/xsectionP xy [_ /xsectionP yz]]. by apply/xsectionP; move: xy yz; exact: entourage_split. Qed. -Lemma continuous_withinNx {U V : uniformType} (f : U -> V) x : +Lemma continuous_withinNx {d d'} {U : uniformType d} {V : uniformType d'} + (f : U -> V) x : {for x, continuous f} <-> f @ x^' --> f x. Proof. split=> - cfx P /= fxP. @@ -285,8 +298,8 @@ rewrite !near_simpl near_withinE near_simpl => Pf; near=> y. by have [->|] := eqVneq y x; [by apply: nbhs_singleton|near: y]. Unshelve. all: by end_near. Qed. -Lemma continuous_injective_withinNx - (T U : topologicalType) (f : T -> U) (x : T) : +Lemma continuous_injective_withinNx d d' + (T : topologicalType d) (U : topologicalType d') (f : T -> U) (x : T) : {for x, continuous f} -> (forall y, f y = f x -> y = x) -> f @ x^' --> (f x)^'. Proof. @@ -298,19 +311,19 @@ by apply/seteqP; split=> y/=; Qed. (* This property is primarily useful for metrizability on uniform spaces *) -Definition countable_uniformity (T : uniformType) := +Definition countable_uniformity d (T : uniformType d) := exists R : set_system (T * T), [/\ countable R, R `<=` entourage & forall P, entourage P -> exists2 Q, R Q & Q `<=` P]. -Lemma countable_uniformityP {T : uniformType} : +Lemma countable_uniformityP {d} {T : uniformType d} : countable_uniformity T <-> exists2 f : nat -> set (T * T), (forall A, entourage A -> exists N, f N `<=` A) & (forall n, entourage (f n)). Proof. split=> [[M []]|[f fsubE entf]]. - move=> /pfcard_geP[-> _ /(_ _ (@entourageT _))[]//|/unsquash f eM Msub]. + move=> /pfcard_geP[-> _ /(_ _ (@entourageT _ _))[]//|/unsquash f eM Msub]. exists f; last by move=> n; apply: eM; exact: funS. by move=> ? /Msub [Q + ?] => /(@surj _ _ _ _ f)[n _ fQ]; exists n; rewrite fQ. exists (range f); split; first exact: card_image_le. @@ -318,17 +331,19 @@ exists (range f); split; first exact: card_image_le. by move=> E /fsubE [n fnA]; exists (f n) => //; exists n. Qed. -Lemma open_nbhs_entourage (U : uniformType) (x : U) (A : set (U * U)) : +Lemma open_nbhs_entourage d (U : uniformType d) (x : U) (A : set (U * U)) : entourage A -> open_nbhs x (xsection A x)°. Proof. move=> entA; split; first exact: open_interior. by apply: nbhs_singleton; apply: nbhs_interior; exact: nbhs_entourage. Qed. -Definition unif_continuous (U V : uniformType) (f : U -> V) := +Definition unif_continuous d d' (U : uniformType d) (V : uniformType d') + (f : U -> V) := (map_pair f) @ entourage --> entourage. -Lemma unif_continuous_continuous (U V : uniformType) (f : U -> V) : +Lemma unif_continuous_continuous d d' + (U : uniformType d) (V : uniformType d') (f : U -> V) : unif_continuous f -> continuous f. Proof. rewrite /unif_continuous /cvg_to !nbhs_simpl => ucf. @@ -340,19 +355,22 @@ rewrite -image_sub => v [] u' /= Yfuu' <-. exact: YX. Qed. -Lemma unif_continuous_comp {U V W : uniformType} (f : U -> V) (g : V -> W) : +Lemma unif_continuous_comp d d' d'' + {U : uniformType d} {V : uniformType d'} {W : uniformType d''} + (f : U -> V) (g : V -> W) : unif_continuous f -> unif_continuous g -> unif_continuous (g \o f). Proof. by move=> cf cg A /cg /cf; exact. Qed. -Definition entourage_set (U : uniformType) (A : set ((set U) * (set U))) := +Definition entourage_set d (U : uniformType d) (A : set ((set U) * (set U))) := exists2 B, entourage B & forall PQ, A PQ -> forall p q, PQ.1 p -> PQ.2 q -> B (p,q). (** Complete uniform spaces *) -Definition cauchy {T : uniformType} (F : set_system T) := (F, F) --> entourage. +Definition cauchy {d} {T : uniformType d} (F : set_system T) := + (F, F) --> entourage. -Lemma cvg_cauchy {T : puniformType} (F : set_system T) : Filter F -> +Lemma cvg_cauchy {d} {T : puniformType d} (F : set_system T) : Filter F -> [cvg F in T] -> cauchy F. Proof. move=> FF cvF A entA; have /entourage_split_ex [B entB sB2A] := entA. @@ -363,22 +381,33 @@ move=> ab [/= /xsectionP Balima /xsectionP Blimb]; apply: sB2A. by exists (lim F). Qed. -HB.mixin Record Uniform_isComplete T & PointedUniform T := { +HB.mixin Record Uniform_isComplete d T & PointedUniform d T := { cauchy_cvg : forall (F : set_system T), ProperFilter F -> cauchy F -> cvg F }. #[short(type="completeType")] -HB.structure Definition Complete := - {T of Uniform T & Uniform_isComplete T & isPointed T}. +HB.structure Definition Complete d := + {T of Uniform d T & Uniform_isComplete d T & isPointed T}. + +HB.instance Definition _ d d' (T : completeType d) := + Uniform_isComplete.Build d' (with_fdisp d' T) cauchy_cvg. Section completeType1. -Context {T : completeType}. +Context {d} {T : completeType d}. Lemma cauchy_cvgP (F : set_system T) (FF : ProperFilter F) : cauchy F <-> cvg F. Proof. by split=> [/cauchy_cvg|/cvg_cauchy]. Qed. End completeType1. -Arguments cauchy_cvg {T} F {FF} _ : rename. -Arguments cauchy_cvgP {T} F {FF}. +Arguments cauchy_cvg {d T} F {FF} _ : rename. +Arguments cauchy_cvgP {d T} F {FF}. + +Module ExplicitNbhsDisplays. +Export topology_structure.ExplicitNbhsDisplays. + +Notation "d .-entourage" := (@entourage d _). +Notation "'entourage'" := (@entourage default_fdisp _) (only printing). + +End ExplicitNbhsDisplays. \ No newline at end of file