From 8f3402830f9576f7a4f91c612658263a05f73a0b Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 12:59:46 +0200 Subject: [PATCH 1/8] Move `is_deriveV` and `is_derive1_comp` to `derive.v` --- theories/derive.v | 18 ++++++++++++++++++ theories/realfun.v | 19 ------------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/theories/derive.v b/theories/derive.v index 07a7aa7cab..83fd93f025 100644 --- a/theories/derive.v +++ b/theories/derive.v @@ -1398,6 +1398,15 @@ move=> df dg; apply/cvg_ex; exists (- (f x) ^- 2 *: 'D_v f x). exact: der_inv. Qed. +Lemma is_deriveV f (x v : V) (df : R) : + f x != 0 -> is_derive x v f df -> + is_derive x v (fun y => (f y)^-1) (- (f x) ^- 2 *: df). +Proof. +move=> fxNZ Df. +constructor; first by apply: derivableV => //; case: Df. +by rewrite deriveV //; case: Df => _ ->. +Qed. + End Derive_lemmasVR. Lemma derive_shift {R : numFieldType} (v k : R) : @@ -2068,6 +2077,15 @@ rewrite diff_comp // !derive1E' //= -[X in 'd _ _ X = _]mulr1. by rewrite [LHS]linearZ mulrC. Qed. +Global Instance is_derive1_comp (R : realFieldType) (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)). + 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) (f g : V -> W) (a v : V) : {near a, f =1 g} -> \forall h \near 0, diff --git a/theories/realfun.v b/theories/realfun.v index dd0e368af8..d2a1326c3d 100644 --- a/theories/realfun.v +++ b/theories/realfun.v @@ -1872,25 +1872,6 @@ apply/continuous_subspaceT=> r. exact/differentiable_continuous/derivable1_diffP. Qed. -Global Instance is_derive1_comp (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)). - 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 is_deriveV (f : R -> R) (x t v : R) : - f x != 0 -> is_derive x v f t -> - is_derive x v (fun y => (f y)^-1) (- (f x) ^- 2 *: t). -Proof. -move=> fxNZ Df. -constructor; first by apply: derivableV => //; case: Df. -by rewrite deriveV //; case: Df => _ ->. -Qed. - Lemma is_derive_inverse (f g : R -> R) l x : {near x, cancel f g} -> {near x, continuous f} -> From bfe3f74d655dd97fd8b7b3e697a11ffd83cd792b Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 13:30:19 +0200 Subject: [PATCH 2/8] New derive lemmas - lemma `derive1Dn` - derivation of functions of form `fun x => k x *: f x` - derivation of shifted functions - lemmas for near-equality of `derive1`/`derive1n` --- theories/derive.v | 117 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 116 insertions(+), 1 deletion(-) diff --git a/theories/derive.v b/theories/derive.v index 83fd93f025..cccec08558 100644 --- a/theories/derive.v +++ b/theories/derive.v @@ -408,6 +408,9 @@ Proof. by []. Qed. Lemma derive1Sn V (f : R -> V) n : f^`(n.+1) = f^`()^`(n). Proof. exact: iterSr. Qed. +Lemma derive1Dn V (f : R -> V) (i j : nat) : f^`(i + j) = f^`(j)^`(i). +Proof. by rewrite /derive1n iterD. Qed. + End DifferentialR2. Notation "f ^` ()" := (derive1 f) : classical_set_scope. Notation "f ^` ( n )" := (derive1n n f) : classical_set_scope. @@ -1254,6 +1257,58 @@ move=> dfx; apply: DeriveDef; first exact: derivableZ. by rewrite deriveZ // derive_val. Qed. +Lemma der1_scaleLR (k : R -> R) (f : R -> V) (x : R) : + derivable k x 1 -> derivable f x 1 -> + h^-1 *: (((fun x0 : R => k x0 *: f x0) \o shift x) h%:A - k x *: f x) + @[h --> 0^'] --> 'D_1 k x *: f x + k x *: 'D_1 f x. +Proof. +move=> der_k der_f. +rewrite /comp/=. +apply: cvg_trans. + apply: near_eq_cvg. + near=> h. + rewrite -[X in _ = _ *: X](addrKA (- (k x *: f (h%:A + x)))) opprD opprK. + rewrite -scalerBl -scalerBr scalerDr [in X in _ = X + _]scalerA. + by rewrite scalerA (mulrC h^-1 (k x)) -[in X in _ = _ + X]scalerA. +apply: cvgD. +- apply: cvgZ; first exact: der_k. + apply: (cvg_comp _ _ (G := nbhs x)). + + apply: cvg0DC. + apply: cvg0MC. + by apply: cvg_within_filter. + + change (continuous_at x f). + by apply/differentiable_continuous/derivable1_diffP. +- apply: cvgZl_tmp. + exact: der_f. +Unshelve. all: by end_near. Qed. + +Global Instance is_derive1ZLR (k : R -> R) (f : R -> V) (x dk : R) (df : V) : + is_derive x 1 k dk -> is_derive x 1 f df -> is_derive x 1 (fun x => k x *: f x) (dk *: f x + k x *: df). +Proof. +move=> [der_k vdk] [der_f vdf]. +constructor. +- apply: cvgP. + by apply: der1_scaleLR. +- apply: norm_cvg_lim. + apply: cvg_to_eq; first by apply: der1_scaleLR. + by rewrite vdk vdf. +Qed. + +Lemma deriveZLR (k : R -> R) (f : R -> V) (x : R) : + derivable k x 1 -> derivable f x 1 -> + 'D_1 (fun x => k x *: f x) x = 'D_1 k x *: f x + k x *: 'D_1 f x. +Proof. +move=> dk df. +by apply: derive_val; apply: is_derive1ZLR; apply: derivableP. +Qed. + +Lemma derivableZLR (k : R -> R) (f : R -> V) (x : R) : + derivable k x 1 -> derivable f x 1 -> derivable (fun x => k x *: f x) x 1. +Proof. +move=> dk df. +by apply: ex_derive; apply: is_derive1ZLR; apply: derivableP. +Qed. + Lemma derive_cst (k : W) (x v : V) : 'D_v (cst k) x = 0. Proof. by rewrite derive_val. Qed. @@ -1419,6 +1474,38 @@ Lemma is_derive_shift {R : numFieldType} x v (k : R) : is_derive x v (shift k) v. Proof. by apply: DeriveDef => //; rewrite derive_val addr0. Qed. +Section derive_shiftf. +Context (R : numFieldType) (V : normedModType R) (f : R -> V). +Implicit Types (x a v : R). + +Lemma derivable_shiftf x a v : + derivable f (x + a) v -> derivable (f \o shift a) x v. +Proof. +rewrite /derivable/=. +by under eq_is_cvg do rewrite addrA. +Qed. + +Lemma derive_shiftf x a v : + 'D_v (f \o shift a) x = 'D_v f (x + a). +Proof. + rewrite /derive/=. + by under [in RHS]eq_fun do rewrite addrA. +Qed. + +Lemma is_derive_shiftf x a (df : V) : + is_derive (x + a) 1 f df -> is_derive x 1 (f \o shift a) df. +Proof. + move=> [/derivable_shiftf derf +]. + rewrite -derive_shiftf => derf_val. + by constructor. +Qed. + +Lemma derive1_shiftf x a : + (f \o shift a)^`() x = f^`() (x + a). +Proof. by rewrite !derive1E derive_shiftf. Qed. + +End derive_shiftf. + Lemma derive1_cst {R : numFieldType} (V : normedModType R) (k : V) t : (cst k)^`() t = 0. Proof. by rewrite derive1E derive_cst. Qed. @@ -1449,6 +1536,10 @@ have /= := @deriveX R R id n x v (@derivable_id _ _ _ _). by rewrite fctE => ->; rewrite derive_id. Qed. +Global Instance is_derive_exp (R : numFieldType) n x v : + is_derive x v (@GRing.exp R ^~ n) (n%:R *: x ^+ n.-1 *: v). +Proof. by constructor; [ exact: exprn_derivable | exact: exp_derive ]. Qed. + 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. @@ -2123,6 +2214,30 @@ move=> fg [fav <-]; rewrite (near_eq_derive _ fg). by apply: DeriveDef => //; exact: near_eq_derivable fav. Qed. +Lemma near_eq_derive1n_near (R : numFieldType) (V : normedModType R) (k : nat) (f g : R -> V) (x : R) : + {near x, f =1 g} -> {near x, f^`(k) =1 g^`(k)}. +Proof. +move=> near_eq. +elim: k => [//|k IH]. +near=> y. +rewrite !derive1nS !derive1E. +apply: near_eq_derive. +near: y. +by rewrite near_nbhs; apply: near_join. +Unshelve. all: by end_near. Qed. + +Lemma near_eq_derive1_near (R : numFieldType) (V : normedModType R) (f g : R -> V) (x : R) : + {near x, f =1 g} -> {near x, f^`() =1 g^`()}. +Proof. rewrite -!derive1n1; exact: near_eq_derive1n_near. Qed. + +Lemma near_eq_derive1n (R : numFieldType) (V : normedModType R) (k : nat) (f g : R -> V) (x : R) : + {near x, f =1 g} -> f^`(k) x = g^`(k) x. +Proof. by move/near_eq_derive1n_near => /(_ k) /nbhs_singleton. Qed. + +Lemma near_eq_derive1 (R : numFieldType) (V : normedModType R) (f g : R -> V) (x : R) : + {near x, f =1 g} -> f^`() x = g^`() x. +Proof. by rewrite -!derive1n1; exact: near_eq_derive1n. Qed. + Section Derive_max. Context {K : realType} {V W : normedModType K}. Implicit Types f g : V -> K^o. @@ -2524,4 +2639,4 @@ move=> dfx dgx; apply: DiffDef; first exact: differentiable_row_mx. by rewrite diff_row_mx// !diff_val. Qed. -End is_diff_row_mx. +End is_diff_row_mx. \ No newline at end of file From 96d668058398831fa4762e371e784913f1f06c56 Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 13:03:07 +0200 Subject: [PATCH 3/8] Update changelog --- CHANGELOG_UNRELEASED.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index 2d85fdc0a5..e566816a2f 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -234,6 +234,12 @@ - in `measurable_structure.v`: + lemmas `countable_bigcap_measurable`, `countable_bigcup_measurable` +- in `derive.v` + + new lemmas `derive1Dn`, `der1_scaleLR`, `deriveZLR`, `derivableZLR`, + `derivable_shiftf`, `derive_shiftf`, `is_derive_shiftf`, `derive1_shiftf`, + `near_eq_derive1n_near`, `near_eq_derive1_near`, `near_eq_derive1n`, and + `near_eq_derive1`. + ### Changed - in `realsum.v`: @@ -354,6 +360,9 @@ - in `classical_sets.v` + lemma `bigcupDr` -> `setD_bigcupr` (deprecating `bigcupDr`) +- moved from `realfun.v` to `derive.v`: + + lemmas `is_deriveV`, `is_derive1_comp`. + ### Renamed - in `tvs.v`: From 8e9b802ed4e8b363536bd083c3bf9d290cf379cf Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 13:53:44 +0200 Subject: [PATCH 4/8] Add dependency on #2029 for CI --- CHANGELOG_UNRELEASED.md | 7 ++++ theories/normedtype_theory/normed_module.v | 24 ++++++++++++ .../pseudometric_normed_Zmodule.v | 39 +++++++++++++++++++ .../probability_theory/beta_distribution.v | 1 - 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index e566816a2f..2ace5a393c 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -234,6 +234,13 @@ - in `measurable_structure.v`: + lemmas `countable_bigcap_measurable`, `countable_bigcup_measurable` +- in file `normed_module.v`, + + new lemmas `cvg1MC`, `cvg1M`, `cvgCM1`, `cvgM1`, `cvg0MC`, `cvg0M`, + `cvgCM0`, and `cvgM0`. +- in file `pseudometric_normed_Zmodule.v`, + + new lemmas `cvgDl`, `cvgDr`, `cvgBl`, `cvgBr`, `cvg0D`, `cvg0DC`, + `cvgD0`, `cvgCD0`, `cvg0B`, `cvg0BC`, `cvgB0`, `cvgCB0`, and `cvgN0`. + - in `derive.v` + new lemmas `derive1Dn`, `der1_scaleLR`, `deriveZLR`, `derivableZLR`, `derivable_shiftf`, `derive_shiftf`, `is_derive_shiftf`, `derive1_shiftf`, diff --git a/theories/normedtype_theory/normed_module.v b/theories/normedtype_theory/normed_module.v index 1252178b3f..94a72d0f8e 100644 --- a/theories/normedtype_theory/normed_module.v +++ b/theories/normedtype_theory/normed_module.v @@ -642,6 +642,30 @@ Proof. exact: cvgZr_tmp. Qed. Lemma cvgMl_tmp g a b : g @ F --> b -> a * g x @[x --> F] --> a * b. Proof. exact: cvgZl_tmp. Qed. +Lemma cvg1MC f a : f @ F --> (1 :> K) -> f x * a @[x --> F] --> a. +Proof. by move/(cvgMr_tmp (b := a)); rewrite mul1r. Qed. + +Lemma cvg1M f g a : f @ F --> (1 :> K) -> g @ F --> a -> f \* g @ F --> a. +Proof. by move=> /cvgM /[apply]; rewrite mul1r. Qed. + +Lemma cvgCM1 f a : f @ F --> (1 :> K) -> a * f x @[x --> F] --> a. +Proof. by move/(cvgMl_tmp (a := a)); rewrite mulr1. Qed. + +Lemma cvgM1 f g a : f @ F --> a -> g @ F --> (1 :> K) -> f \* g @ F --> a. +Proof. by move=> /cvgM /[apply]; rewrite mulr1. Qed. + +Lemma cvg0MC f a : f @ F --> 0 -> f x * a @[x --> F] --> 0. +Proof. by move/(cvgMr_tmp (b := a)); rewrite mul0r. Qed. + +Lemma cvg0M f g a : f @ F --> 0 -> g @ F --> a -> f \* g @ F --> 0. +Proof. by move=> /cvgM /[apply]; rewrite mul0r. Qed. + +Lemma cvgCM0 f a : f @ F --> 0 -> a * f x @[x --> F] --> 0. +Proof. by move/(cvgMl_tmp (a := a)); rewrite mulr0. Qed. + +Lemma cvgM0 f g a : f @ F --> a -> g @ F --> 0 -> f \* g @ F --> 0. +Proof. by move=> /cvgM /[apply]; rewrite mulr0. Qed. + Lemma is_cvgM f g : cvg (f @ F) -> cvg (g @ F) -> cvg (f \* g @ F). Proof. exact: is_cvgZ. Qed. diff --git a/theories/normedtype_theory/pseudometric_normed_Zmodule.v b/theories/normedtype_theory/pseudometric_normed_Zmodule.v index 9f945624de..82c259cf1f 100644 --- a/theories/normedtype_theory/pseudometric_normed_Zmodule.v +++ b/theories/normedtype_theory/pseudometric_normed_Zmodule.v @@ -1098,6 +1098,45 @@ Qed. Lemma is_cvgDrE f g : cvg (f @ F) -> cvg ((f + g) @ F) = cvg (g @ F). Proof. by rewrite addrC; apply: is_cvgDlE. Qed. +Lemma cvgDl f a b : f @ F --> b -> a + f x @[x --> F] --> a + b. +Proof. apply: cvgD; exact: cvg_cst. Qed. + +Lemma cvgDr f a b : f @ F --> a -> f x + b @[x --> F] --> a + b. +Proof. move/cvgD; apply; exact: cvg_cst. Qed. + +Lemma cvgBl f a b : f @ F --> b -> a - f x @[x --> F] --> a - b. +Proof. by move/cvgN; apply: cvgDl. Qed. + +Lemma cvgBr f a b : f @ F --> a -> f x - b @[x --> F] --> a - b. +Proof. exact: cvgDr. Qed. + +Lemma cvg0D f g a : f @ F --> 0 -> g @ F --> a -> f x + g x @[x --> F] --> a. +Proof. by move=> /cvgD /[apply]; rewrite add0r. Qed. + +Lemma cvg0DC f a : f @ F --> 0 -> f x + a @[x --> F] --> a. +Proof. by move=> /(cvgDr (b := a)); rewrite add0r. Qed. + +Lemma cvgD0 f g a : f @ F --> a -> g @ F --> 0 -> f x + g x @[x --> F] --> a. +Proof. by move=> /cvgD /[apply]; rewrite addr0. Qed. + +Lemma cvgCD0 f a : f @ F --> 0 -> a + f x @[x --> F] --> a. +Proof. by move/(@cvgDl _ a); rewrite addr0. Qed. + +Lemma cvg0B f g a : f @ F --> 0 -> g @ F --> a -> f x - g x @[x --> F] --> -a. +Proof. by move=> /cvgB /[apply]; rewrite add0r. Qed. + +Lemma cvg0BC f a : f @ F --> 0 -> f x - a @[x --> F] --> -a. +Proof. by move=> /(cvgBr (b := a)); rewrite add0r. Qed. + +Lemma cvgB0 f g a : f @ F --> a -> g @ F --> 0 -> f x - g x @[x --> F] --> a. +Proof. by move=> /cvgB /[apply]; rewrite subr0. Qed. + +Lemma cvgCB0 f a : f @ F --> 0 -> a - f x @[x --> F] --> a. +Proof. by move/(@cvgBl _ a); rewrite subr0. Qed. + +Lemma cvgN0 f : f @ F --> 0 -> - f @ F --> 0. +Proof. by rewrite -{2}oppr0; exact: cvgN. Qed. + Lemma cvg_sub0 f g a : (f - g) @ F --> (0 : V) -> g @ F --> a -> f @ F --> a. Proof. by move=> Cfg Cg; have := cvgD Cfg Cg; rewrite subrK add0r; apply. diff --git a/theories/probability_theory/beta_distribution.v b/theories/probability_theory/beta_distribution.v index 9a879b1443..832378557a 100644 --- a/theories/probability_theory/beta_distribution.v +++ b/theories/probability_theory/beta_distribution.v @@ -77,7 +77,6 @@ Lemma derive_onemXn n x : (fun y => y.~ ^+ n)^`()%classic x = - n%:R * x.~ ^+ n.-1. Proof. rewrite (@derive1_comp _ (@onem _) (fun x => x ^+ n))//. - exact: exprn_derivable. rewrite derive1E exp_derive// derive1E deriveB// -derive1E. by rewrite derive1_cst derive_id sub0r mulrN1 [in RHS]mulNr scaler1. Qed. From 553bc3a46c381ccccaede8b2f6a9231a5a596907 Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 14:03:30 +0200 Subject: [PATCH 5/8] Add dependency on #2027 for CI --- CHANGELOG_UNRELEASED.md | 10 ++++ theories/topology_theory/function_spaces.v | 5 ++ theories/topology_theory/metric_structure.v | 27 ----------- theories/topology_theory/nat_topology.v | 12 +++++ theories/topology_theory/num_topology.v | 54 +++++++++++++++++++++ 5 files changed, 81 insertions(+), 27 deletions(-) diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index 2ace5a393c..f646190c7a 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -234,6 +234,14 @@ - in `measurable_structure.v`: + lemmas `countable_bigcap_measurable`, `countable_bigcup_measurable` +- in file `function_spaces.v`, + + new lemma `within_continuous_big`. +- in file `nat_topology.v`, + + new lemma `near_infty_after`. +- in file `num_topology.v`, + + new lemmas `at_rightD`, `at_leftD`, `near_at_rightD`, `near_at_leftD`, + `at_left_shift`, and `at_right_shift`. + - in file `normed_module.v`, + new lemmas `cvg1MC`, `cvg1M`, `cvgCM1`, `cvgM1`, `cvg0MC`, `cvg0M`, `cvgCM0`, and `cvgM0`. @@ -369,6 +377,8 @@ - moved from `realfun.v` to `derive.v`: + lemmas `is_deriveV`, `is_derive1_comp`. +- moved from `metric_structure.v` to `num_topology.v`: + + lemma `cvg_at_right_left_dnbhs`, generalized to `topologicalType` from `metricType`. ### Renamed diff --git a/theories/topology_theory/function_spaces.v b/theories/topology_theory/function_spaces.v index 8c82e106d0..432d5a00bc 100644 --- a/theories/topology_theory/function_spaces.v +++ b/theories/topology_theory/function_spaces.v @@ -1600,6 +1600,11 @@ 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) : + (forall (i : I), P i -> {within A, continuous (F i)}) -> + {within A, continuous (fun x : T => \big[op/x0]_(i <- r | P i) F i x)}. +Proof. by move=> cont_F x; apply: continuous_big. Qed. + End big_continuous. Definition eval {X Y : topologicalType} : continuousType X Y * X -> Y := diff --git a/theories/topology_theory/metric_structure.v b/theories/topology_theory/metric_structure.v index d9477e84cb..34da60f8d8 100644 --- a/theories/topology_theory/metric_structure.v +++ b/theories/topology_theory/metric_structure.v @@ -315,33 +315,6 @@ Unshelve. all: end_near. Qed. End cvg_nbhsP. -Section cvg_at_right_left_dnbhs. -Variables (R : realFieldType) (T : metricType R). - -Import metricType_numDomainType. - -Lemma cvg_at_right_left_dnbhs (f : R -> T) (p : R) (l : T) : - f x @[x --> p^'+] --> l -> f x @[x --> p^'-] --> l -> - f x @[x --> p^'] --> l. -Proof. -move=> /cvgrPdist_le fppl /cvgrPdist_le fpnl; apply/cvgrPdist_le => e e0. -have {fppl}[a /= a0 fppl] := fppl (at_right_proper_filter p) _ e0. -have {fpnl}[b /= b0 fpnl] := fpnl (at_left_proper_filter p) _ e0. -near=> t. -have : t != p by near: t; exact: nbhs_dnbhs_neq. -rewrite neq_lt => /orP[tp|pt]. -- apply: fpnl => //=; near: t. - exists (b / 2) => //=; first by rewrite divr_gt0. - move=> z/= + _ => /lt_le_trans; apply. - by rewrite ler_pdivrMr// ler_pMr// ler1n. -- apply: fppl =>//=; near: t. - exists (a / 2) => //=; first by rewrite divr_gt0. - move=> z/= + _ => /lt_le_trans; apply. - by rewrite ler_pdivrMr// ler_pMr// ler1n. -Unshelve. all: by end_near. Qed. - -End cvg_at_right_left_dnbhs. - Section at_left_rightR. Variable (R : numFieldType). diff --git a/theories/topology_theory/nat_topology.v b/theories/topology_theory/nat_topology.v index e2d0274f38..49ae67d0ac 100644 --- a/theories/topology_theory/nat_topology.v +++ b/theories/topology_theory/nat_topology.v @@ -93,6 +93,18 @@ Lemma near_inftyS (P : set nat) : (\forall x \near \oo, P (S x)) -> (\forall x \near \oo, P x). Proof. case=> N _ NPS; exists (S N) => // [[]]; rewrite /= ?ltn0 //. Qed. +Lemma near_infty_after (P : set nat) : + (\forall n \near \oo, P n) <-> (\forall N \near \oo, forall n, (n >= N)%N -> P n). +Proof. +split. +- move=> [N _ afterN]. + exists N => // n /= /[swap] n' /leq_trans /[apply]. + exact: afterN. +- move=> [N _ afterN]. + exists N => // n /=. + by apply: afterN => /=. +Qed. + Section infty_nat. Local Open Scope nat_scope. diff --git a/theories/topology_theory/num_topology.v b/theories/topology_theory/num_topology.v index fc7caea215..69e4cda5e5 100644 --- a/theories/topology_theory/num_topology.v +++ b/theories/topology_theory/num_topology.v @@ -241,6 +241,50 @@ split=> [pPf e|ex_notPx]. by rewrite /ball/= ltr0_norm ?subr_lt0// opprB ltrBlDl. Unshelve. all: by end_near. Qed. +Lemma at_rightD x a : (x + a)^'+ = (y + a @[y --> x^'+]). +Proof. +apply/seteqP; split=> P /=. +- move=> [/= r r0 br_sub]. + exists r => // y bxy x_lt_y. + apply: br_sub => /=. + + by rewrite (addrC y) addrKA. + + by rewrite ltrD2r. +- move=> [/= r r0 br_sub]. + exists r => // y bxay xDa_lt_y. + rewrite -(subrK a y). + apply: br_sub => /=. + + by rewrite opprB addrA. + + by rewrite ltrBrDr. +Qed. + +Lemma at_leftD x a : (x + a)^'- = (y + a @[y --> x^'-]). +Proof. +apply/seteqP; split=> P /=. +- move=> [/= r r0 br_sub]. + exists r => // y bxy x_gt_y. + apply: br_sub => /=. + + by rewrite (addrC y) addrKA. + + by rewrite ltrD2r. +- move=> [/= r r0 br_sub]. + exists r => // y bxay xDa_gt_y. + rewrite -(subrK a y). + apply: br_sub => /=. + + by rewrite opprB addrA. + + by rewrite ltrBlDr. +Qed. + +Lemma near_at_rightD x a (P : set R) : (\forall y \near (x + a)^'+, P y) = (\forall y \near x^'+, P (y + a)). +Proof. by rewrite at_rightD near_map. Qed. + +Lemma near_at_leftD x a (P : set R) : (\forall y \near (x + a)^'-, P y) = (\forall y \near x^'-, P (y + a)). +Proof. by rewrite at_leftD near_map. Qed. + +Lemma at_left_shift (T : Type) x a (f : R -> T) : (f @ (x + a)^'-) = (f (y + a) @[y --> x^'-]). +Proof. by rewrite at_leftD. Qed. + +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. + End at_left_right. #[global] Typeclasses Opaque at_left at_right. Notation "x ^'-" := (at_left x) : classical_set_scope. @@ -252,6 +296,16 @@ 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) (f : R -> T) (p : R) (l : T) : + f x @[x --> p^'+] --> l -> f x @[x --> p^'-] --> l -> f x @[x --> p^'] --> l. +Proof. +move=> + + U Uz => /(_ U Uz) + /(_ U Uz); near_simpl. +rewrite !near_withinE !near_nbhs => lf rf. +apply: filter_app lf; apply: filter_app rf. +near=> t => xlt xgt. +by case/lt_total/orP. +Unshelve. all: by end_near. Qed. + Lemma left_right_continuousP {R : realFieldType} {T : topologicalType} (f : R -> T) x : f @ x^'- --> f x /\ f @ x^'+ --> f x <-> f @ x --> f x. From 49b25e079dc8bffce346e5d119bf6c7f261004a8 Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 17:02:17 +0200 Subject: [PATCH 6/8] Correct dependency to #2024 --- CHANGELOG_UNRELEASED.md | 12 +---- classical/filter.v | 52 ++++++++++++++++++++ theories/topology_theory/function_spaces.v | 5 -- theories/topology_theory/metric_structure.v | 27 +++++++++++ theories/topology_theory/nat_topology.v | 12 ----- theories/topology_theory/num_topology.v | 54 --------------------- 6 files changed, 81 insertions(+), 81 deletions(-) diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index f646190c7a..97af2be1c7 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -126,6 +126,8 @@ - in `filter.v`: + mixin `isSubNbhs`, structure `SubNbhs`, notation `subNbhsType` + + new lemmas `near_eq_cvgE`, `near_eq_is_cvg`, `near_eq_lim`, + `cvg_to_eq`, `cvg_to_withinP`, and `within_cvg_to_within`. - in `topology_structure.v`: + structure `SubTopological`, notation `subTopologicalType` @@ -234,14 +236,6 @@ - in `measurable_structure.v`: + lemmas `countable_bigcap_measurable`, `countable_bigcup_measurable` -- in file `function_spaces.v`, - + new lemma `within_continuous_big`. -- in file `nat_topology.v`, - + new lemma `near_infty_after`. -- in file `num_topology.v`, - + new lemmas `at_rightD`, `at_leftD`, `near_at_rightD`, `near_at_leftD`, - `at_left_shift`, and `at_right_shift`. - - in file `normed_module.v`, + new lemmas `cvg1MC`, `cvg1M`, `cvgCM1`, `cvgM1`, `cvg0MC`, `cvg0M`, `cvgCM0`, and `cvgM0`. @@ -377,8 +371,6 @@ - moved from `realfun.v` to `derive.v`: + lemmas `is_deriveV`, `is_derive1_comp`. -- moved from `metric_structure.v` to `num_topology.v`: - + lemma `cvg_at_right_left_dnbhs`, generalized to `topologicalType` from `metricType`. ### Renamed diff --git a/classical/filter.v b/classical/filter.v index b26d00d72f..4233a6d9bc 100644 --- a/classical/filter.v +++ b/classical/filter.v @@ -925,10 +925,23 @@ Lemma near_eq_cvg {T U} {F : set_system T} {FF : Filter F} (f g : T -> U) : {near F, f =1 g} -> g @ F `=>` f @ F. Proof. by move=> eq_fg P /=; apply: filterS2 eq_fg => x /= <-. Qed. +Lemma near_eq_cvgE {T U} {F : set_system T} {FF : Filter F} (f g : T -> U) : + {near F, f =1 g} -> f @ F = g @ F. +Proof. +move=> eq_fg. +apply/seteqP; split; apply: near_eq_cvg => //. +by near do symmetry. +Unshelve. all: by end_near. +Qed. + Lemma eq_cvg (T T' : Type) (F : set_system T) (f g : T -> T') (x : set_system T') : f =1 g -> (f @ F --> x) = (g @ F --> x). Proof. by move=> /funext->. Qed. +Lemma near_eq_is_cvg (T : Type) (T' : pnbhsType) (F : set_system T) (f g : T -> T') : + Filter F -> {near F, g =1 f} -> cvg (f x @[x --> F]) -> cvg(g x @[x --> F]). +Proof. by move=> /@near_eq_cvgE /[apply] ->. Qed. + Lemma eq_is_cvg_in (T T' : Type) (fT : pfilteredType T') (F : set_system T) (f g : T -> T') : f =1 g -> [cvg (f @ F) in fT] = [cvg (g @ F) in fT]. Proof. by move=> /funext->. Qed. @@ -937,6 +950,14 @@ Lemma eq_is_cvg (T : Type) (T' : pnbhsType) (F : set_system T) (f g : T -> T') : f =1 g -> cvg (f @ F) = cvg (g @ F). Proof. by move=> /funext->. Qed. +Lemma near_eq_lim (T : Type) (T' : pnbhsType) {F : set_system T} {FF : Filter F} (f g : T -> T') : + {near F, f =1 g} -> lim (f @ F) = lim (g @ F). +Proof. by move=> /near_eq_cvgE ->. Qed. + +Lemma cvg_to_eq {T : nbhsType} {F : set_system T} (l l' : T) : + F --> l' -> l = l' -> F --> l. +Proof. by move=> + ->. Qed. + Lemma neari_eq_loc {T U} {F : set_system T} {FF : Filter F} (f g : T -> set U) : {near F, f =2 g} -> g `@ F `=>` f `@ F. Proof. @@ -1197,6 +1218,25 @@ Qed. End within. +Lemma cvg_to_withinP (T U : Type) {F : set_system T} {FF : Filter F} {G : set_system U} {FG : Filter G} + (f : T -> U) (A : set U) : + (f @ F --> within A G) <-> (f @ F --> G /\ \forall x \near F, A (f x)). +Proof. +split. + move=> cvg_w; split. + - apply: (cvg_trans cvg_w). + exact: cvg_within. + - apply: cvg_w. + exact: withinT. +move=> [cvgT nearfA] P. +rewrite !nbhs_nearE near_withinE. +move: cvgT => /[apply]. +rewrite near_map appfilter nbhs_nearE => nearF_AP. +near=> x. +suff : A (f x) by near: x. +by near: x. +Unshelve. all: by end_near. Qed. + Global Instance within_filter T D F : Filter F -> Filter (@within T D F). Proof. move=> FF; rewrite /within; constructor => /=. @@ -1210,6 +1250,18 @@ Qed. Canonical within_filter_on T D (F : filter_on T) := FilterType (within D F) (within_filter _ _). +Lemma within_cvg_to_within (T U : Type) {F : set_system T} {FF : Filter F} {G : set_system U} {FG : Filter G} + (f : T -> U) (A : set T) (B : set U) : + (\forall x \near F, A x -> B (f x)) -> f @ F --> G -> f @ within A F --> within B G. +Proof. +move=> near_hom cvgT. +apply/cvg_to_withinP; split. +- apply: cvg_trans cvgT. + apply: cvg_app. + exact: cvg_within. +- by rewrite near_withinE. +Qed. + Lemma filter_bigI_within T (I : choiceType) (D : {fset I}) (f : I -> set T) (F : set_system T) (P : set T) : Filter F -> (forall i, i \in D -> F [set j | P j -> f i j]) -> diff --git a/theories/topology_theory/function_spaces.v b/theories/topology_theory/function_spaces.v index 432d5a00bc..8c82e106d0 100644 --- a/theories/topology_theory/function_spaces.v +++ b/theories/topology_theory/function_spaces.v @@ -1600,11 +1600,6 @@ 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) : - (forall (i : I), P i -> {within A, continuous (F i)}) -> - {within A, continuous (fun x : T => \big[op/x0]_(i <- r | P i) F i x)}. -Proof. by move=> cont_F x; apply: continuous_big. Qed. - End big_continuous. Definition eval {X Y : topologicalType} : continuousType X Y * X -> Y := diff --git a/theories/topology_theory/metric_structure.v b/theories/topology_theory/metric_structure.v index 34da60f8d8..d9477e84cb 100644 --- a/theories/topology_theory/metric_structure.v +++ b/theories/topology_theory/metric_structure.v @@ -315,6 +315,33 @@ Unshelve. all: end_near. Qed. End cvg_nbhsP. +Section cvg_at_right_left_dnbhs. +Variables (R : realFieldType) (T : metricType R). + +Import metricType_numDomainType. + +Lemma cvg_at_right_left_dnbhs (f : R -> T) (p : R) (l : T) : + f x @[x --> p^'+] --> l -> f x @[x --> p^'-] --> l -> + f x @[x --> p^'] --> l. +Proof. +move=> /cvgrPdist_le fppl /cvgrPdist_le fpnl; apply/cvgrPdist_le => e e0. +have {fppl}[a /= a0 fppl] := fppl (at_right_proper_filter p) _ e0. +have {fpnl}[b /= b0 fpnl] := fpnl (at_left_proper_filter p) _ e0. +near=> t. +have : t != p by near: t; exact: nbhs_dnbhs_neq. +rewrite neq_lt => /orP[tp|pt]. +- apply: fpnl => //=; near: t. + exists (b / 2) => //=; first by rewrite divr_gt0. + move=> z/= + _ => /lt_le_trans; apply. + by rewrite ler_pdivrMr// ler_pMr// ler1n. +- apply: fppl =>//=; near: t. + exists (a / 2) => //=; first by rewrite divr_gt0. + move=> z/= + _ => /lt_le_trans; apply. + by rewrite ler_pdivrMr// ler_pMr// ler1n. +Unshelve. all: by end_near. Qed. + +End cvg_at_right_left_dnbhs. + Section at_left_rightR. Variable (R : numFieldType). diff --git a/theories/topology_theory/nat_topology.v b/theories/topology_theory/nat_topology.v index 49ae67d0ac..e2d0274f38 100644 --- a/theories/topology_theory/nat_topology.v +++ b/theories/topology_theory/nat_topology.v @@ -93,18 +93,6 @@ Lemma near_inftyS (P : set nat) : (\forall x \near \oo, P (S x)) -> (\forall x \near \oo, P x). Proof. case=> N _ NPS; exists (S N) => // [[]]; rewrite /= ?ltn0 //. Qed. -Lemma near_infty_after (P : set nat) : - (\forall n \near \oo, P n) <-> (\forall N \near \oo, forall n, (n >= N)%N -> P n). -Proof. -split. -- move=> [N _ afterN]. - exists N => // n /= /[swap] n' /leq_trans /[apply]. - exact: afterN. -- move=> [N _ afterN]. - exists N => // n /=. - by apply: afterN => /=. -Qed. - Section infty_nat. Local Open Scope nat_scope. diff --git a/theories/topology_theory/num_topology.v b/theories/topology_theory/num_topology.v index 69e4cda5e5..fc7caea215 100644 --- a/theories/topology_theory/num_topology.v +++ b/theories/topology_theory/num_topology.v @@ -241,50 +241,6 @@ split=> [pPf e|ex_notPx]. by rewrite /ball/= ltr0_norm ?subr_lt0// opprB ltrBlDl. Unshelve. all: by end_near. Qed. -Lemma at_rightD x a : (x + a)^'+ = (y + a @[y --> x^'+]). -Proof. -apply/seteqP; split=> P /=. -- move=> [/= r r0 br_sub]. - exists r => // y bxy x_lt_y. - apply: br_sub => /=. - + by rewrite (addrC y) addrKA. - + by rewrite ltrD2r. -- move=> [/= r r0 br_sub]. - exists r => // y bxay xDa_lt_y. - rewrite -(subrK a y). - apply: br_sub => /=. - + by rewrite opprB addrA. - + by rewrite ltrBrDr. -Qed. - -Lemma at_leftD x a : (x + a)^'- = (y + a @[y --> x^'-]). -Proof. -apply/seteqP; split=> P /=. -- move=> [/= r r0 br_sub]. - exists r => // y bxy x_gt_y. - apply: br_sub => /=. - + by rewrite (addrC y) addrKA. - + by rewrite ltrD2r. -- move=> [/= r r0 br_sub]. - exists r => // y bxay xDa_gt_y. - rewrite -(subrK a y). - apply: br_sub => /=. - + by rewrite opprB addrA. - + by rewrite ltrBlDr. -Qed. - -Lemma near_at_rightD x a (P : set R) : (\forall y \near (x + a)^'+, P y) = (\forall y \near x^'+, P (y + a)). -Proof. by rewrite at_rightD near_map. Qed. - -Lemma near_at_leftD x a (P : set R) : (\forall y \near (x + a)^'-, P y) = (\forall y \near x^'-, P (y + a)). -Proof. by rewrite at_leftD near_map. Qed. - -Lemma at_left_shift (T : Type) x a (f : R -> T) : (f @ (x + a)^'-) = (f (y + a) @[y --> x^'-]). -Proof. by rewrite at_leftD. Qed. - -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. - End at_left_right. #[global] Typeclasses Opaque at_left at_right. Notation "x ^'-" := (at_left x) : classical_set_scope. @@ -296,16 +252,6 @@ 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) (f : R -> T) (p : R) (l : T) : - f x @[x --> p^'+] --> l -> f x @[x --> p^'-] --> l -> f x @[x --> p^'] --> l. -Proof. -move=> + + U Uz => /(_ U Uz) + /(_ U Uz); near_simpl. -rewrite !near_withinE !near_nbhs => lf rf. -apply: filter_app lf; apply: filter_app rf. -near=> t => xlt xgt. -by case/lt_total/orP. -Unshelve. all: by end_near. Qed. - Lemma left_right_continuousP {R : realFieldType} {T : topologicalType} (f : R -> T) x : f @ x^'- --> f x /\ f @ x^'+ --> f x <-> f @ x --> f x. From 22499af6de6f388bc2240c9c2518a445818377f9 Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 17:24:39 +0200 Subject: [PATCH 7/8] derivable_oo_LRcontinuous stability lemmas --- theories/realfun.v | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/theories/realfun.v b/theories/realfun.v index d2a1326c3d..a282a28059 100644 --- a/theories/realfun.v +++ b/theories/realfun.v @@ -1118,6 +1118,85 @@ apply/differentiable_continuous; rewrite -derivable1_diffP. by apply: df; rewrite in_itv. Qed. +Lemma derivable_oo_LRcontinuousZ (a b k : R) (f : R -> V) : + derivable_oo_LRcontinuous f a b -> derivable_oo_LRcontinuous (k \*: f) a b. +Proof. +move=> [der_oo liml limr]. +split. +- move=> x x_ab. + apply: derivableZ. + by apply: der_oo. +- by apply: cvgZl_tmp. +- by apply: cvgZl_tmp. +Qed. + +Lemma derivable_oo_LRcontinuousD (a b : R) (f g : R -> V) : + derivable_oo_LRcontinuous f a b -> derivable_oo_LRcontinuous g a b -> derivable_oo_LRcontinuous (f \+ g) a b. +Proof. +move=> [fder_oo f_contl f_contr] [gder_oo g_contl g_contr]. +split. +- move=> x x_ab. + apply: derivableD. + + by apply: fder_oo. + + by apply: gder_oo. +- by apply: cvgD. +- by apply: cvgD. +Qed. + +Lemma derivable_oo_LRcontinuousN (a b : R) (f : R -> V) : + derivable_oo_LRcontinuous f a b -> derivable_oo_LRcontinuous (\- f) a b. +Proof. +move=> [fder_oo f_contl f_contr]. +split. +- move=> x x_ab. + apply: derivableN. + by apply: fder_oo. +- by apply: cvgN. +- by apply: cvgN. +Qed. + +Lemma derivable_oo_LRcontinuous_shift (a b c : R) (f : R -> V) : + derivable_oo_LRcontinuous f (a + c) (b + c) -> derivable_oo_LRcontinuous (f \o shift c) a b. +Proof. +move=> [fder_oo f_contl f_contr]. +split. +- move=> x x_ab. + apply: derivable_shiftf. + apply: fder_oo. + move: x_ab. + by rewrite !in_itv/= !ltrD2r. +- apply: cvg_comp f_contl. + apply: within_cvg_to_within (cvgDr _) => //. + by near=> x; rewrite ltrD2r. +- apply: cvg_comp f_contr. + apply: within_cvg_to_within (cvgDr _) => //. + by near=> x; rewrite ltrD2r. +Unshelve. all: by end_near. Qed. + +Lemma derivable_oo_LRcontinuousS (a b : R) (A : set R) (f : R -> V) : + {in A, forall x, derivable f x 1} -> `[a, b] `<=` A -> a <= b -> derivable_oo_LRcontinuous f a b. +Proof. +move=> df ab_sub_A a_le_b. +split. +- move=> x x_ab. + apply: df. + apply: mem_set. + apply: ab_sub_A => /=. + by apply: subset_itv x_ab; rewrite bnd_simp. +- apply: cvg_at_right_filter. + apply: differentiable_continuous; apply/derivable1_diffP. + apply: df. + apply: mem_set. + apply: ab_sub_A. + by rewrite /= bound_itvE. +- apply: cvg_at_left_filter. + apply: differentiable_continuous; apply/derivable1_diffP. + apply: df. + apply: mem_set. + apply: ab_sub_A. + by rewrite /= bound_itvE. +Qed. + End derivable_oo_LRcontinuous. #[deprecated(since="mathcomp-analysis 1.14.0", note="use `derivable_oo_LRcontinuous` instead")] Notation derivable_oo_continuous_bnd := derivable_oo_LRcontinuous (only parsing). From 4ca912a85de610ae44ae75a5ccc1d728e92bfc85 Mon Sep 17 00:00:00 2001 From: Arthur Molina-Mounier Date: Wed, 15 Jul 2026 17:25:19 +0200 Subject: [PATCH 8/8] Update changelog --- CHANGELOG_UNRELEASED.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index 97af2be1c7..f3a6fe9d03 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -249,6 +249,11 @@ `near_eq_derive1n_near`, `near_eq_derive1_near`, `near_eq_derive1n`, and `near_eq_derive1`. +- in file `realfun.v`, + + new lemmas `derivable_oo_LRcontinuousZ`, `derivable_oo_LRcontinuousD`, + `derivable_oo_LRcontinuousN`, `derivable_oo_LRcontinuous_shift`, and + `derivable_oo_LRcontinuousS`. + ### Changed - in `realsum.v`: