Skip to content

Commit 84a032e

Browse files
affeldt-aistproux01
authored andcommitted
fixes #1133
1 parent 2f24ede commit 84a032e

File tree

4 files changed

+84
-51
lines changed

4 files changed

+84
-51
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@
132132
- in `derive.v`:
133133
+ lemmas `differentiable_rsubmx`, `differentiable_lsubmx`
134134

135+
- in `unstable.v`:
136+
+ definitions `monotonic`, `strict_monotonic`
137+
+ lemma `strict_monotonicW`
138+
135139
### Changed
136140

137141
- in `charge.v`:
@@ -238,6 +242,10 @@
238242
`continuous_within_itvNycP`
239243
+ lemma `within_continuous_continuous`
240244
+ lemmas `open_itvoo_subset`, `open_itvcc_subset`, `realFieldType`
245+
- in `num_normedtype.v`:
246+
+ weaken hypothesis in lemmas `mono_mem_image_segment`, `mono_surj_image_segment`,
247+
`inc_surj_image_segment`, `dec_surj_image_segment`, `inc_surj_image_segmentP`,
248+
`dec_surj_image_segmentP`, `mono_surj_image_segmentP`
241249

242250
### Deprecated
243251

@@ -285,6 +293,9 @@
285293
- in `set_interval.v`:
286294
+ lemma `interval_set1` (use `set_itv1` instead)
287295

296+
- in `unstable.v`:
297+
+ definition `monotonous` (use `strict_monotonic` instead)
298+
288299
### Infrastructure
289300

290301
### Misc

classical/unstable.v

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2022 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *)
22
From mathcomp Require Import all_ssreflect finmap ssralg ssrnum ssrint.
33
From mathcomp Require Import archimedean interval mathcomp_extra.
44

@@ -15,8 +15,10 @@ From mathcomp Require Import archimedean interval mathcomp_extra.
1515
(* ``` *)
1616
(* swap x := (x.2, x.1) *)
1717
(* map_pair f x := (f x.1, f x.2) *)
18-
(* monotonous A f := {in A &, {mono f : x y / x <= y}} \/ *)
19-
(* {in A &, {mono f : x y /~ x <= y}} *)
18+
(* monotonic A f := {in A &, {homo f : x y / x <= y}} \/ *)
19+
(* {in A &, {homo f : x y /~ x <= y}} *)
20+
(* strict_monotonic A f := {in A &, {homo f : x y / x < y}} \/ *)
21+
(* {in A &, {homo f : x y /~ x < y}} *)
2022
(* sigT_fun f := lifts a family of functions f into a function on *)
2123
(* the dependent sum *)
2224
(* prodA x := sends (X * Y) * Z to X * (Y * Z) *)
@@ -164,8 +166,20 @@ rewrite -[X in (_ <= X)%N]prednK ?expn_gt0// -[X in (_ <= X)%N]addn1 leq_add2r.
164166
by rewrite (leq_trans h2)// -subn1 leq_subRL ?expn_gt0// add1n ltn_exp2l.
165167
Qed.
166168

167-
Definition monotonous d (T : porderType d) (pT : predType T) (A : pT) (f : T -> T) :=
168-
{in A &, {mono f : x y / (x <= y)%O}} \/ {in A &, {mono f : x y /~ (x <= y)%O}}.
169+
Definition monotonic d (T : porderType d) d' (T' : porderType d')
170+
(pT : predType T) (A : pT) (f : T -> T') :=
171+
{in A &, nondecreasing f} \/ {in A &, {homo f : x y /~ (x <= y)%O}}.
172+
173+
Definition strict_monotonic d (T : porderType d) d' (T' : porderType d')
174+
(pT : predType T) (A : pT) (f : T -> T') :=
175+
{in A &, {homo f : x y / (x < y)%O}} \/ {in A &, {homo f : x y /~ (x < y)%O}}.
176+
177+
Lemma strict_monotonicW d (T : orderType d) d' (T' : porderType d')
178+
(pT : predType T) (A : pT) (f : T -> T') :
179+
strict_monotonic A f -> monotonic A f.
180+
Proof.
181+
by move=> [/le_mono_in/monoW_in|/le_nmono_in/monoW_in]; [left|right].
182+
Qed.
169183

170184
Lemma mono_leq_infl f : {mono f : m n / (m <= n)%N} -> forall n, (n <= f n)%N.
171185
Proof.

theories/normedtype_theory/num_normedtype.v

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Section image_interval.
8080
Variable R : realDomainType.
8181
Implicit Types (a b : R) (f : R -> R).
8282

83-
Lemma mono_mem_image_segment a b f : monotonous `[a, b] f ->
83+
Lemma mono_mem_image_segment a b f : monotonic `[a, b] f ->
8484
{homo f : x / x \in `[a, b] >-> x \in f @`[a, b]}.
8585
Proof.
8686
move=> [fle|fge] x xab; have leab : a <= b by rewrite (itvP xab).
@@ -90,22 +90,22 @@ have: f a >= f b by rewrite fge ?bound_itvE.
9090
by case: leP => // fafb _; rewrite in_itv/= !fge ?(itvP xab).
9191
Qed.
9292

93-
Lemma mono_mem_image_itvoo a b f : monotonous `[a, b] f ->
93+
Lemma mono_mem_image_itvoo a b f : strict_monotonic `[a, b] f ->
9494
{homo f : x / x \in `]a, b[ >-> x \in f @`]a, b[}.
9595
Proof.
96-
move=> []/[dup] => [/leW_mono_in|/leW_nmono_in] flt fle x xab;
96+
move=> []/[dup] => [/le_mono_in|/le_nmono_in] flt fle x xab;
9797
have ltab : a < b by rewrite (itvP xab).
98-
have: f a <= f b by rewrite ?fle ?bound_itvE ?ltW.
99-
by case: leP => // fafb _; rewrite in_itv/= ?flt ?in_itv/= ?(itvP xab, lexx).
100-
have: f a >= f b by rewrite fle ?bound_itvE ?ltW.
101-
by case: leP => // fafb _; rewrite in_itv/= ?flt ?in_itv/= ?(itvP xab, lexx).
98+
have: f a <= f b by rewrite flt ?bound_itvE ltW.
99+
by case: leP => // fafb _; rewrite in_itv/= !fle ?in_itv/= ?(itvP xab, lexx).
100+
have: f a >= f b by rewrite flt ?bound_itvE ?ltW.
101+
by case: leP => // fafb _; rewrite in_itv/= !fle ?in_itv/= ?(itvP xab, lexx).
102102
Qed.
103103

104104
Lemma mono_surj_image_segment a b f : a <= b ->
105-
monotonous `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
105+
monotonic `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
106106
(f @` `[a, b] = f @`[a, b])%classic.
107107
Proof.
108-
move=> leab fmono; apply: surj_image_eq => _ /= [x xab <-];
108+
move=> leab fmono; apply: surj_image_eq => _ /= [x xab <-].
109109
exact: mono_mem_image_segment.
110110
Qed.
111111

@@ -116,7 +116,7 @@ Lemma dec_segment_image a b f : f b <= f a -> f @`[a, b] = `[f b, f a].
116116
Proof. by case: ltrP. Qed.
117117

118118
Lemma inc_surj_image_segment a b f : a <= b ->
119-
{in `[a, b] &, {mono f : x y / x <= y}} ->
119+
{in `[a, b] &, {homo f : x y / x <= y}} ->
120120
set_surj `[a, b] `[f a, f b] f ->
121121
f @` `[a, b] = `[f a, f b]%classic.
122122
Proof.
@@ -125,7 +125,7 @@ by rewrite mono_surj_image_segment ?inc_segment_image//; left.
125125
Qed.
126126

127127
Lemma dec_surj_image_segment a b f : a <= b ->
128-
{in `[a, b] &, {mono f : x y /~ x <= y}} ->
128+
{in `[a, b] &, {homo f : x y /~ x <= y}} ->
129129
set_surj `[a, b] `[f b, f a] f ->
130130
f @` `[a, b] = `[f b, f a]%classic.
131131
Proof.
@@ -134,7 +134,7 @@ by rewrite mono_surj_image_segment ?dec_segment_image//; right.
134134
Qed.
135135

136136
Lemma inc_surj_image_segmentP a b f : a <= b ->
137-
{in `[a, b] &, {mono f : x y / x <= y}} ->
137+
{in `[a, b] &, {homo f : x y / x <= y}} ->
138138
set_surj `[a, b] `[f a, f b] f ->
139139
forall y, reflect (exists2 x, x \in `[a, b] & f x = y) (y \in `[f a, f b]).
140140
Proof.
@@ -143,7 +143,7 @@ by apply/(equivP idP); symmetry.
143143
Qed.
144144

145145
Lemma dec_surj_image_segmentP a b f : a <= b ->
146-
{in `[a, b] &, {mono f : x y /~ x <= y}} ->
146+
{in `[a, b] &, {homo f : x y /~ x <= y}} ->
147147
set_surj `[a, b] `[f b, f a] f ->
148148
forall y, reflect (exists2 x, x \in `[a, b] & f x = y) (y \in `[f b, f a]).
149149
Proof.
@@ -152,7 +152,7 @@ by apply/(equivP idP); symmetry.
152152
Qed.
153153

154154
Lemma mono_surj_image_segmentP a b f : a <= b ->
155-
monotonous `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
155+
monotonic `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
156156
forall y, reflect (exists2 x, x \in `[a, b] & f x = y) (y \in f @`[a, b]).
157157
Proof.
158158
move=> /mono_surj_image_segment/[apply]/[apply]/predeqP + y => /(_ y) fab.

theories/realfun.v

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,39 +1399,43 @@ by move/oppr_inj; apply/fI.
13991399
Qed.
14001400

14011401
Lemma itv_continuous_inj_mono f (I : interval R) :
1402-
{within [set` I], continuous f} -> {in I &, injective f} -> monotonous I f.
1402+
{within [set` I], continuous f} -> {in I &, injective f} ->
1403+
strict_monotonic I f.
14031404
Proof.
14041405
move=> fC fI.
14051406
case: (pselect (exists a b, [/\ a \in I , b \in I & a < b])); last first.
1406-
move=> N2I; left => x y xI yI; suff -> : x = y by rewrite ?lexx.
1407-
by apply: contra_notP N2I => /eqP; case: ltgtP; [exists x, y|exists y, x|].
1407+
move=> N2I; left => x y xI yI xy; apply: contra_notT N2I.
1408+
by rewrite -leNgt; case: ltgtP xy; [exists x, y|exists y, x|].
14081409
move=> [a [b [aI bI lt_ab]]].
14091410
have /orP[faLfb|fbLfa] := le_total (f a) (f b).
1410-
by left; apply: itv_continuous_inj_le => //; exists a, b; rewrite ?faLfb.
1411-
by right; apply: itv_continuous_inj_ge => //; exists a, b; rewrite ?fbLfa.
1411+
- left; apply/monoW_in/leW_mono_in/itv_continuous_inj_le => //.
1412+
by exists a, b; rewrite faLfb.
1413+
- right; apply/monoW_in/leW_nmono_in/itv_continuous_inj_ge => //.
1414+
by exists a, b; rewrite ?fbLfa.
14121415
Qed.
14131416

14141417
Lemma segment_continuous_inj_le f a b :
1415-
f a <= f b -> {within `[a, b], continuous f} -> {in `[a, b] &, injective f} ->
1418+
f a <= f b -> {within `[a, b], continuous f} ->
1419+
{in `[a, b] &, injective f} ->
14161420
{in `[a, b] &, {mono f : x y / x <= y}}.
14171421
Proof.
1418-
move=> fafb fct finj; have [//|] := itv_continuous_inj_mono fct finj.
1422+
move=> fafb fct finj; have [/le_mono_in//|] := itv_continuous_inj_mono fct finj.
14191423
have [aLb|bLa|<-] := ltrgtP a b; first 1 last.
14201424
- by move=> _ x ?; rewrite itv_ge// -ltNge.
14211425
- by move=> _ x y /itvxxP-> /itvxxP->; rewrite !lexx.
1422-
move=> /(_ a b); rewrite !bound_itvE fafb.
1423-
by move=> /(_ (ltW aLb) (ltW aLb)); rewrite lt_geF.
1426+
move/le_nmono_in/(_ a b); rewrite !bound_itvE fafb.
1427+
by move=> /(_ (ltW aLb) (ltW aLb)); rewrite lt_geF.
14241428
Qed.
14251429

14261430
Lemma segment_continuous_inj_ge f a b :
14271431
f a >= f b -> {within `[a, b], continuous f} -> {in `[a, b] &, injective f} ->
14281432
{in `[a, b] &, {mono f : x y /~ x <= y}}.
14291433
Proof.
1430-
move=> fafb fct finj; have [|//] := itv_continuous_inj_mono fct finj.
1434+
move=> fafb fct finj; have [|/le_nmono_in//] := itv_continuous_inj_mono fct finj.
14311435
have [aLb|bLa|<-] := ltrgtP a b; first 1 last.
14321436
- by move=> _ x ?; rewrite itv_ge// -ltNge.
14331437
- by move=> _ x y /itvxxP-> /itvxxP->; rewrite !lexx.
1434-
move=> /(_ b a); rewrite !bound_itvE fafb.
1438+
move/le_mono_in/(_ b a); rewrite !bound_itvE fafb.
14351439
by move=> /(_ (ltW aLb) (ltW aLb)); rewrite lt_geF.
14361440
Qed.
14371441

@@ -1480,11 +1484,13 @@ Qed.
14801484

14811485
Lemma segment_can_mono a b f g : a <= b ->
14821486
{within `[a, b], continuous f} -> {in `[a, b], cancel f g} ->
1483-
monotonous (f @`[a, b]) g.
1487+
strict_monotonic (f @`[a, b]) g.
14841488
Proof.
1485-
move=> le_ab fct fK; rewrite /monotonous/=; case: ltrgtP => fab; [left|right..];
1486-
do ?by [apply: segment_can_le|apply: segment_can_ge].
1487-
by move=> x y /itvxxP<- /itvxxP<-; rewrite !lexx.
1489+
move=> le_ab fct fK.
1490+
rewrite /strict_monotonic/=; case: ltrgtP => fab; [left|right..].
1491+
- exact/monoW_in/leW_mono_in/segment_can_le.
1492+
- exact/monoW_in/leW_nmono_in/segment_can_ge.
1493+
- by move=> x y /itvxxP<- /itvxxP<-; rewrite ltxx.
14881494
Qed.
14891495

14901496
Lemma segment_continuous_surjective a b f : a <= b ->
@@ -1510,7 +1516,7 @@ Lemma continuous_inj_image_segment a b f : a <= b ->
15101516
f @` `[a, b] = (f @`[a, b])%classic.
15111517
Proof.
15121518
move=> leab fct finj; apply: mono_surj_image_segment => //.
1513-
exact: itv_continuous_inj_mono.
1519+
exact/strict_monotonicW/itv_continuous_inj_mono.
15141520
exact: segment_continuous_surjective.
15151521
Qed.
15161522

@@ -1527,7 +1533,7 @@ Lemma segment_continuous_can_sym a b f g : a <= b ->
15271533
{in f @`[a, b], cancel g f}.
15281534
Proof.
15291535
move=> aLb ctf fK; have g_mono := segment_can_mono aLb ctf fK.
1530-
have f_mono := itv_continuous_inj_mono ctf (can_in_inj fK).
1536+
have /strict_monotonicW f_mono := itv_continuous_inj_mono ctf (can_in_inj fK).
15311537
have f_surj := segment_continuous_surjective aLb ctf.
15321538
have fIP := mono_surj_image_segmentP aLb f_mono f_surj.
15331539
suff: {in f @`[a, b], {on `[a, b], cancel g & f}}.
@@ -1566,7 +1572,8 @@ have [aLb|bLa|] := ltgtP a b; first last.
15661572
by move=> /andP[/le_trans] /[apply]; rewrite leNgt bLa.
15671573
have le_ab : a <= b by rewrite ltW.
15681574
have [aab bab] : a \in `[a, b] /\ b \in `[a, b] by rewrite !bound_itvE ltW.
1569-
have fab : f @` `[a, b] = `[f a, f b]%classic by exact:inc_surj_image_segment.
1575+
have fab : f @` `[a, b] = `[f a, f b]%classic.
1576+
by apply: inc_surj_image_segment => //; exact/monoW_in.
15701577
pose g := pinv `[a, b] f; have fK : {in `[a, b], cancel f g}.
15711578
by rewrite -[mem _]mem_setE; apply: pinvKV; rewrite !mem_setE.
15721579
have gK : {in `[f a, f b], cancel g f} by move=> z zab; rewrite pinvK// fab inE.
@@ -1644,16 +1651,20 @@ by move=> y /=; rewrite -oppr_itvcc => /f_surj[x ? /(canLR opprK)<-]; exists x.
16441651
Qed.
16451652

16461653
Lemma segment_mono_surj_continuous a b f :
1647-
monotonous `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
1654+
strict_monotonic `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
16481655
{within `[a, b], continuous f}.
16491656
Proof.
1650-
rewrite continuous_subspace_in => -[fle|fge] f_surj x /set_mem /= xab.
1657+
rewrite continuous_subspace_in => -[flt|fge] f_surj x /set_mem /= xab.
16511658
have leab : a <= b by rewrite (itvP xab).
1652-
have fafb : f a <= f b by rewrite fle // ?bound_itvE.
1653-
by apply: segment_inc_surj_continuous => //; case: ltrP f_surj fafb.
1659+
have fafb : f a <= f b.
1660+
by move/ltW_homo_in : flt => ->//; rewrite ?bound_itvE.
1661+
apply: segment_inc_surj_continuous => //; case: ltrP f_surj fafb => //.
1662+
by move=> fafb f_surj _; exact/le_mono_in.
16541663
have leab : a <= b by rewrite (itvP xab).
1655-
have fafb : f b <= f a by rewrite fge // ?bound_itvE.
1656-
by apply: segment_dec_surj_continuous => //; case: ltrP f_surj fafb.
1664+
have fafb : f b <= f a.
1665+
by move/ltW_nhomo_in : fge => ->//; rewrite ?bound_itvE.
1666+
apply: segment_dec_surj_continuous => //; case: ltrP f_surj fafb => //.
1667+
by move=> fafb f_surj _; exact/le_nmono_in.
16571668
Qed.
16581669

16591670
Lemma segment_can_le_continuous a b f g : a <= b ->
@@ -2854,22 +2865,19 @@ Lemma lhopital :
28542865
df x / dg x @[x --> c] --> l -> f x / g x @[x --> c^'] --> l.
28552866
Proof.
28562867
move=> fgcl; apply/cvg_at_right_left_dnbhs.
2857-
- apply (@lhopital_at_right R f df g dg c b l); try exact/cvg_at_right_filter.
2868+
- apply: (@lhopital_at_right R f df g dg c b l); try exact/cvg_at_right_filter.
28582869
+ by move: cab; rewrite in_itv/= => /andP[].
28592870
+ move=> x xac; apply: fdf; rewrite set_itv_splitU ?in_setU//=.
28602871
by apply/orP; right; rewrite inE.
28612872
+ move=> x xac; apply: gdg; rewrite set_itv_splitU ?in_setU//=.
28622873
by apply/orP; right; rewrite inE.
28632874
+ move=> x xac; apply: cdg; rewrite set_itv_splitU ?in_setU//=.
28642875
by apply/orP; right; rewrite inE.
2865-
- apply (@lhopital_at_left R f df g dg a c l); try exact/cvg_at_left_filter.
2876+
- apply: (@lhopital_at_left R f df g dg a c l); try exact/cvg_at_left_filter.
28662877
+ by move: cab; rewrite in_itv/= => /andP[].
2867-
+ move=> x xac; apply: fdf; rewrite set_itv_splitU ?in_setU//=.
2868-
+ by apply/orP; left; rewrite inE.
2869-
+ move=> x xac; apply: gdg; rewrite set_itv_splitU ?in_setU//=.
2870-
by apply/orP; left; rewrite inE.
2871-
+ move=> x xac; apply: cdg; rewrite set_itv_splitU ?in_setU//=.
2872-
by apply/orP; left; rewrite inE.
2878+
+ by move=> x xac; apply: fdf; rewrite set_itv_splitU ?in_setU// mem_setE xac.
2879+
+ by move=> x xac; apply: gdg; rewrite set_itv_splitU ?in_setU// mem_setE xac.
2880+
+ by move=> x xac; apply: cdg; rewrite set_itv_splitU ?in_setU// mem_setE xac.
28732881
Qed.
28742882

28752883
End lhopital.

0 commit comments

Comments
 (0)