Skip to content

Commit 1acba88

Browse files
authored
a few small generalizations (#1817)
Co-authored-by: @holgerthies
1 parent 2632c4c commit 1acba88

File tree

5 files changed

+35
-24
lines changed

5 files changed

+35
-24
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,15 @@
202202
* lemmas `total_variationxx`, `nondecreasing_total_variation`,
203203
`total_variationN`
204204

205+
- in `num_topology.v`:
206+
+ lemma `in_continuous_mksetP`
207+
208+
- in `pseudometric_normed_Zmodule.v`:
209+
+ lemmas `continuous_within_itvP`, `continuous_within_itvcyP`,
210+
`continuous_within_itvNycP`
211+
+ lemma `within_continuous_continuous`
212+
+ lemmas `open_itvoo_subset`, `open_itvcc_subset`, `realFieldType`
213+
205214
### Deprecated
206215

207216
- in `topology_structure.v`:

theories/ftc.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect ssralg ssrnum ssrint interval finmap.
44
From mathcomp Require Import archimedean.

theories/normedtype_theory/pseudometric_normed_Zmodule.v

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect finmap ssralg ssrnum ssrint interval.
44
From mathcomp Require Import archimedean.
@@ -858,7 +858,7 @@ Unshelve. all: by end_near. Qed.
858858
End closure_left_right_open.
859859

860860
Section open_itv_subset.
861-
Context {R : realType}.
861+
Context {R : realFieldType}.
862862
Variables (A : set R) (x : R).
863863

864864
Lemma open_itvoo_subset :
@@ -884,7 +884,7 @@ Qed.
884884

885885
End open_itv_subset.
886886

887-
Lemma dense_set1C {R : realType} (r : R) : dense (~` [set r]).
887+
Lemma dense_set1C {R : realFieldType} (r : R) : dense (~` [set r]).
888888
Proof.
889889
move=> /= O O0 oO.
890890
suff [s Os /eqP sr] : exists2 s, O s & s != r by exists s; split.
@@ -1023,15 +1023,16 @@ Definition nbhs_simpl := (nbhs_simpl,@nbhs_nbhs_norm,@filter_from_norm_nbhs).
10231023
End NbhsNorm.
10241024

10251025
Section continuous_within_itvP.
1026-
Context {R : realType}.
1027-
Implicit Type f : R -> R.
1026+
Context {R : realFieldType} {K : numDomainType}
1027+
{U : pseudoMetricNormedZmodType K}.
1028+
Implicit Type f : R -> U.
10281029

10291030
Let near_at_left (a : itv_bound R) b f eps : (a < BLeft b)%O -> 0 < eps ->
10301031
{within [set` Interval a (BRight b)], continuous f} ->
10311032
\forall t \near b^'-, `|f b - f t| < eps.
10321033
Proof.
10331034
move=> ab eps_gt0 cf.
1034-
move/continuous_withinNx/(@cvgrPdist_lt _ R^o)/(_ _ eps_gt0) : (cf b).
1035+
move/continuous_withinNx/cvgrPdist_lt/(_ _ eps_gt0) : (cf b).
10351036
rewrite /dnbhs/= near_withinE !near_simpl /prop_near1 /nbhs/=.
10361037
rewrite -nbhs_subspace_in//; last first.
10371038
rewrite /= in_itv/= lexx andbT.
@@ -1050,7 +1051,7 @@ Let near_at_right a (b : itv_bound R) f eps : (BRight a < b)%O -> 0 < eps ->
10501051
\forall t \near a^'+, `|f a - f t| < eps.
10511052
Proof.
10521053
move=> ab eps_gt0 cf.
1053-
move/continuous_withinNx/(@cvgrPdist_lt _ R^o)/(_ _ eps_gt0) : (cf a).
1054+
move/continuous_withinNx/cvgrPdist_lt/(_ _ eps_gt0) : (cf a).
10541055
rewrite /dnbhs/= near_withinE !near_simpl// /prop_near1 /nbhs/=.
10551056
rewrite -nbhs_subspace_in//; last first.
10561057
rewrite /= in_itv/= lexx//=.
@@ -1069,21 +1070,21 @@ Lemma continuous_within_itvP a b f : a < b ->
10691070
[/\ {in `]a, b[, continuous f}, f @ a^'+ --> f a & f @b^'- --> f b].
10701071
Proof.
10711072
move=> ab; split=> [abf|].
1072-
split; [apply/in_continuous_mksetP|apply/(@cvgrPdist_lt _ R^o) => eps eps_gt0 /=..].
1073+
split; [apply/in_continuous_mksetP|apply/cvgrPdist_lt => eps eps_gt0 /=..].
10731074
- rewrite -continuous_open_subspace; last exact: interval_open.
10741075
by move: abf; exact/continuous_subspaceW/subset_itvW.
10751076
- by apply: near_at_right => //; rewrite bnd_simp.
10761077
- by apply: near_at_left => //; rewrite bnd_simp.
10771078
case=> ctsoo ctsL ctsR; apply/subspace_continuousP => x /andP[].
10781079
rewrite !bnd_simp/= !le_eqVlt => /predU1P[<-{x}|ax] /predU1P[|].
10791080
- by move/eqP; rewrite lt_eqF.
1080-
- move=> _; apply/(@cvgrPdist_lt _ R^o) => eps eps_gt0 /=.
1081-
move/(@cvgrPdist_lt _ R^o)/(_ _ eps_gt0): ctsL; rewrite /at_right !near_withinE.
1081+
- move=> _; apply/cvgrPdist_lt => eps eps_gt0 /=.
1082+
move/cvgrPdist_lt/(_ _ eps_gt0): ctsL; rewrite /at_right !near_withinE.
10821083
apply: filter_app; exists (b - a); rewrite /= ?subr_gt0// => c cba + ac.
10831084
have : a <= c by move: ac => /andP[].
10841085
by rewrite le_eqVlt => /predU1P[->|/[swap] /[apply]//]; rewrite subrr normr0.
1085-
- move=> ->; apply/(@cvgrPdist_lt _ R^o) => eps eps_gt0 /=.
1086-
move/(@cvgrPdist_lt _ R^o)/(_ _ eps_gt0): ctsR; rewrite /at_left !near_withinE.
1086+
- move=> ->; apply/cvgrPdist_lt => eps eps_gt0 /=.
1087+
move/cvgrPdist_lt/(_ _ eps_gt0): ctsR; rewrite /at_left !near_withinE.
10871088
apply: filter_app; exists (b - a); rewrite /= ?subr_gt0 // => c cba + ac.
10881089
have : c <= b by move: ac => /andP[].
10891090
by rewrite le_eqVlt => /predU1P[->|/[swap] /[apply]//]; rewrite subrr normr0.
@@ -1093,18 +1094,18 @@ rewrite !bnd_simp/= !le_eqVlt => /predU1P[<-{x}|ax] /predU1P[|].
10931094
by rewrite -open_subsetE; [exact: subset_itvW| exact: interval_open].
10941095
Qed.
10951096

1096-
Lemma continuous_within_itvcyP a (f : R -> R) :
1097+
Lemma continuous_within_itvcyP a f :
10971098
{within `[a, +oo[, continuous f} <->
10981099
{in `]a, +oo[, continuous f} /\ f x @[x --> a^'+] --> f a.
10991100
Proof.
11001101
split=> [cf|].
1101-
split; [apply/in_continuous_mksetP|apply/(@cvgrPdist_lt _ R^o) => eps eps_gt0 /=].
1102+
split; [apply/in_continuous_mksetP|apply/cvgrPdist_lt => eps eps_gt0 /=].
11021103
- rewrite -continuous_open_subspace; last exact: interval_open.
11031104
by apply: continuous_subspaceW cf => ?; rewrite /= !in_itv !andbT/= => /ltW.
11041105
- by apply: near_at_right => //; rewrite bnd_simp.
11051106
move=> [cf fa]; apply/subspace_continuousP => x /andP[].
11061107
rewrite bnd_simp/= le_eqVlt => /predU1P[<-{x}|ax] _.
1107-
- apply/(@cvgrPdist_lt _ R^o) => eps eps_gt0/=; move/(@cvgrPdist_lt _ R^o)/(_ _ eps_gt0) : fa.
1108+
- apply/cvgrPdist_lt => eps eps_gt0/=; move/cvgrPdist_lt/(_ _ eps_gt0) : fa.
11081109
rewrite /at_right !near_withinE; apply: filter_app.
11091110
exists 1%R => //= c c1a /[swap]; rewrite in_itv/= andbT le_eqVlt.
11101111
by move=> /predU1P[->|/[swap]/[apply]//]; rewrite subrr normr0.
@@ -1115,18 +1116,18 @@ rewrite bnd_simp/= le_eqVlt => /predU1P[<-{x}|ax] _.
11151116
by move=> ?/=; rewrite !in_itv/= !andbT; exact: ltW.
11161117
Qed.
11171118

1118-
Lemma continuous_within_itvNycP b (f : R -> R) :
1119+
Lemma continuous_within_itvNycP b f :
11191120
{within `]-oo, b], continuous f} <->
11201121
{in `]-oo, b[, continuous f} /\ f x @[x --> b^'-] --> f b.
11211122
Proof.
11221123
split=> [cf|].
1123-
split; [apply/in_continuous_mksetP|apply/(@cvgrPdist_lt _ R^o) => eps eps_gt0 /=].
1124+
split; [apply/in_continuous_mksetP|apply/cvgrPdist_lt => eps eps_gt0 /=].
11241125
- rewrite -continuous_open_subspace; last exact: interval_open.
11251126
by apply: continuous_subspaceW cf => ?/=; rewrite !in_itv/=; exact: ltW.
11261127
- by apply: near_at_left => //; rewrite bnd_simp.
11271128
move=> [cf fb]; apply/subspace_continuousP => x /andP[_].
11281129
rewrite bnd_simp/= le_eqVlt=> /predU1P[->{x}|xb].
1129-
- apply/(@cvgrPdist_lt _ R^o) => eps eps_gt0/=; move/(@cvgrPdist_lt _ R^o)/(_ _ eps_gt0) : fb.
1130+
- apply/cvgrPdist_lt => eps eps_gt0/=; move/cvgrPdist_lt/(_ _ eps_gt0) : fb.
11301131
rewrite /at_right !near_withinE; apply: filter_app.
11311132
exists 1%R => //= c c1b /[swap]; rewrite in_itv/= le_eqVlt.
11321133
by move=> /predU1P[->|/[swap]/[apply]//]; rewrite subrr normr0.
@@ -1139,7 +1140,8 @@ Qed.
11391140

11401141
End continuous_within_itvP.
11411142

1142-
Lemma within_continuous_continuous {R : realType} a b (f : R -> R) x : (a < b)%R ->
1143+
Lemma within_continuous_continuous {R : realFieldType} {K : numDomainType}
1144+
{U : pseudoMetricNormedZmodType K} a b (f : R -> U) x : (a < b)%R ->
11431145
{within `[a, b], continuous f} -> x \in `]a, b[ -> {for x, continuous f}.
11441146
Proof.
11451147
by move=> ab /continuous_within_itvP-/(_ ab)[+ _] /[swap] xab cf; exact.

theories/realfun.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect finmap ssralg ssrnum ssrint.
44
From mathcomp Require Import archimedean interval.
@@ -2267,7 +2267,7 @@ Lemma total_variation_continuous a b (f : R -> R) : a < b ->
22672267
BV a b f ->
22682268
{within `[a,b], continuous (fine \o TV a ^~ f)}.
22692269
Proof.
2270-
move=> ab /(@continuous_within_itvP _ _ _ _ ab) [int l r] bdf.
2270+
move=> ab /(continuous_within_itvP _ ab) [int l r] bdf.
22712271
apply/continuous_within_itvP => //; split.
22722272
- move=> x /[dup] xab; rewrite in_itv /= => /andP [ax xb].
22732273
apply/left_right_continuousP; split.

theories/topology_theory/num_topology.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect all_algebra all_classical.
44
From mathcomp Require Import interval_inference reals topology_structure.
@@ -258,7 +258,7 @@ move=> s res rs; rewrite -(opprK s); apply: reE; last by rewrite -memNE.
258258
by rewrite /= opprK -normrN opprD.
259259
Qed.
260260

261-
Lemma in_continuous_mksetP {T : realFieldType} {U : realFieldType}
261+
Lemma in_continuous_mksetP {T : realFieldType} {U : nbhsType}
262262
(i : interval T) (f : T -> U) :
263263
{in i, continuous f} <-> {in [set` i], continuous f}.
264264
Proof.

0 commit comments

Comments
 (0)