From 3e2830ce5653f4142476e5380a46219cfac456d5 Mon Sep 17 00:00:00 2001 From: Reynald Affeldt Date: Mon, 29 Jun 2026 20:55:11 +0900 Subject: [PATCH 1/4] reduce dep --- theories/measure_theory/measurable_function.v | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/theories/measure_theory/measurable_function.v b/theories/measure_theory/measurable_function.v index 061d3b958c..ea845e68e5 100644 --- a/theories/measure_theory/measurable_function.v +++ b/theories/measure_theory/measurable_function.v @@ -1,11 +1,10 @@ (* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *) From HB Require Import structures. -From mathcomp Require Import all_ssreflect_compat algebra. +From mathcomp Require Import all_ssreflect_compat. #[warning="-warn-library-file-internal-analysis"] From mathcomp Require Import unstable. -From mathcomp Require Import boolp classical_sets functions cardinality reals. -From mathcomp Require Import ereal topology normedtype. -From mathcomp Require Import sequences measurable_structure. +From mathcomp Require Import boolp classical_sets functions. +From mathcomp Require Import measurable_structure. (**md**************************************************************************) (* # Measurable Functions *) @@ -29,7 +28,6 @@ Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import ProperNotations. -Import Order.TTheory GRing.Theory Num.Theory. Local Open Scope classical_set_scope. Local Open Scope ring_scope. @@ -358,7 +356,7 @@ Context {d} {T : measurableType d} {d1} {T1 : measurableType d1} Lemma g_sigma_algebra_preimage_comp (X : {mfun T >-> T1}) (f : T1 -> T2) : measurable_fun [set: T1] f -> - g_sigma_algebra_preimage (f \o X)%R `<=` g_sigma_algebra_preimage X. + g_sigma_algebra_preimage (f \o X) `<=` g_sigma_algebra_preimage X. Proof. exact: preimage_set_system_compS. Qed. End g_sigma_algebra_preimage_comp. From e9c4b2ccfcc64ac93a0fb277049852f0f8d5a25c Mon Sep 17 00:00:00 2001 From: Reynald Affeldt Date: Tue, 30 Jun 2026 16:13:36 +0900 Subject: [PATCH 2/4] make normed module depends on metric --- .../normedtype_theory/matrix_normedtype.v | 3 ++ theories/normedtype_theory/normed_module.v | 34 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/theories/normedtype_theory/matrix_normedtype.v b/theories/normedtype_theory/matrix_normedtype.v index 3cd89248c9..af82f8eaa1 100644 --- a/theories/normedtype_theory/matrix_normedtype.v +++ b/theories/normedtype_theory/matrix_normedtype.v @@ -251,6 +251,9 @@ HB.instance Definition _ (K : numFieldType) m n := PseudoMetricNormedZmod_Lmodule_isNormedModule.Build K 'M[K]_(m, n) (@mx_normZ K m n). +HB.instance Definition _ (K : numFieldType) m n := + isNormedModule.Build _ 'M[K]_(m, n). + End matrix_NormedModule. Lemma continuous_mx {V : topologicalType} {R : realFieldType} {m n : nat} diff --git a/theories/normedtype_theory/normed_module.v b/theories/normedtype_theory/normed_module.v index c57a771abc..57ef3929aa 100644 --- a/theories/normedtype_theory/normed_module.v +++ b/theories/normedtype_theory/normed_module.v @@ -92,11 +92,33 @@ HB.mixin Record PseudoMetricNormedZmod_ConvexTvs_isNormedModule K V normrZ : forall (l : K) (x : V), `| l *: x | = `| l | * `| x |; }. -#[short(type="normedModType")] -HB.structure Definition NormedModule (K : numDomainType) := +HB.structure Definition NormedModule0 (K : numDomainType) := {T of PseudoMetricNormedZmod K T & ConvexTvs K T & PseudoMetricNormedZmod_ConvexTvs_isNormedModule K T}. +#[short(type="normedModType")] +HB.structure Definition NormedModule (K : numDomainType) := + {T of NormedModule0 K T & Metric K T}. + +HB.factory Record isNormedModule (K : numDomainType) T of NormedModule0 K T := { }. + +HB.builders Context K T of isNormedModule K T. + +Let mdist (x y : T) : K := `|x - y|. + +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]. +Proof. by rewrite -ball_normE. Qed. + +HB.instance Definition _ := + @PseudoMetric_isMetric.Build K T mdist mdist_ge0 mdist_positivity ballEmdist. + +HB.end. + #[short(type="subNormedModType")] HB.structure Definition SubNormedModule (R : numDomainType) (V : normedModType R) (S : pred V) := @@ -1721,7 +1743,7 @@ Qed. Section prod_NormedModule. Context {K : numFieldType} {U V : normedModType K}. -Lemma prod_norm_scale (l : K) (x : U * V) : `| l *: x | = `|l| * `| x |. +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 _ := @@ -1730,6 +1752,9 @@ HB.instance Definition _ := End prod_NormedModule. +HB.instance Definition _ (R : numFieldType) (U V' : normedModType R) := + isNormedModule.Build _ (U * V')%type. + Section prod_NormedModule_lemmas. Context {T : Type} {K : numDomainType} {U V : normedModType K}. @@ -2657,6 +2682,9 @@ HB.instance Definition _ (V : vectType R) := PseudoMetricNormedZmod_Lmodule_isNormedModule.Build R (max_space V) (@Norm.normZ _ _ (@max_norm V)). +HB.instance Definition _ (V : vectType R) := + isNormedModule.Build _ (max_space V). + (* NB: Get Trocq to prove the continuity part automatically. *) Lemma sup_closed_ball_compact (V : vectType R) : compact (closed_ball (0 : max_space V) 1). From 2cf3927216e17f8f9fab9e113b8dfb698de549e8 Mon Sep 17 00:00:00 2001 From: Reynald Affeldt Date: Tue, 30 Jun 2026 19:01:36 +0900 Subject: [PATCH 3/4] fix --- theories/normedtype_theory/normed_module.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theories/normedtype_theory/normed_module.v b/theories/normedtype_theory/normed_module.v index 57ef3929aa..a6d9267c53 100644 --- a/theories/normedtype_theory/normed_module.v +++ b/theories/normedtype_theory/normed_module.v @@ -100,7 +100,7 @@ HB.structure Definition NormedModule0 (K : numDomainType) := HB.structure Definition NormedModule (K : numDomainType) := {T of NormedModule0 K T & Metric K T}. -HB.factory Record isNormedModule (K : numDomainType) T of NormedModule0 K T := { }. +HB.factory Record isNormedModule (K : numDomainType) T & NormedModule0 K T := { }. HB.builders Context K T of isNormedModule K T. From 7f296d8d2b65a8296c349f3d2130e1024667e679 Mon Sep 17 00:00:00 2001 From: Reynald Affeldt Date: Tue, 30 Jun 2026 21:12:05 +0900 Subject: [PATCH 4/4] fix --- theories/normedtype_theory/normed_module.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theories/normedtype_theory/normed_module.v b/theories/normedtype_theory/normed_module.v index a6d9267c53..7716dd3a5c 100644 --- a/theories/normedtype_theory/normed_module.v +++ b/theories/normedtype_theory/normed_module.v @@ -102,7 +102,7 @@ HB.structure Definition NormedModule (K : numDomainType) := HB.factory Record isNormedModule (K : numDomainType) T & NormedModule0 K T := { }. -HB.builders Context K T of isNormedModule K T. +HB.builders Context K T & isNormedModule K T. Let mdist (x y : T) : K := `|x - y|.