Skip to content

Commit dd87ea1

Browse files
committed
last fixes
1 parent e79e424 commit dd87ea1

File tree

6 files changed

+62
-168
lines changed

6 files changed

+62
-168
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
### Added
66

7-
### Changed
8-
9-
- in `Rstruct.v`
10-
+ instantiate `GRinv.inv` by `Rinv` instead of `Rinvx`
11-
127
- in `mathcomp_extra.v`:
138
+ lemmas `prodr_ile1`, `nat_int`
149

@@ -119,6 +114,15 @@
119114
- new file `measurable_realfun.v`
120115
+ with as contents the first half of the file `lebesgue_measure.v`
121116

117+
- in `set_interval.v`:
118+
+ lemma `set_itv_splitU`
119+
120+
- in `normedtype.v`:
121+
+ lemma `lt_nbhsr`
122+
123+
- in `realfun.v`:
124+
+ lemmas `lhopital_at_left`, `lhopital_at_left`, `lhopital`,
125+
122126
### Changed
123127

124128
- in `lebesgue_integral.v`
@@ -148,6 +152,9 @@
148152
- file `lebesgue_measure.v`
149153
+ first half moved to a new file `measurable_realfun.v`
150154

155+
- in `Rstruct.v`
156+
+ instantiate `GRinv.inv` by `Rinv` instead of `Rinvx`
157+
151158
### Renamed
152159

153160
- in `measure.v`
@@ -171,6 +178,10 @@
171178
- in `lebesgue_integral.v`:
172179
+ `Rintegral_setU_EFin` -> `Rintegral_setU`
173180

181+
- in `normedtype.v`:
182+
+ `nbhs_lt` -> `lt_nbhsl_lt`
183+
+ `nbhs_le` -> `lt_nbhsl_le`
184+
174185
### Generalized
175186

176187
- in `sequences.v`,

classical/set_interval.v

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Notation subset_itvS := subset_itvScc (only parsing).
234234

235235
Section set_itv_orderType.
236236
Variables (d : Order.disp_t) (T : orderType d).
237-
Implicit Types a x y : itv_bound T.
237+
Implicit Types a b x y : itv_bound T.
238238

239239
Lemma itv_bndbnd_setU a x y : (a <= x)%O -> (x <= y)%O ->
240240
([set` Interval a y] = [set` Interval a x] `|` [set` Interval x y])%classic.
@@ -293,6 +293,26 @@ move: a ax => [b t /= tx| [/= oox|/= oox]].
293293
- by move: x => [[|] x|[|]//]/= in xy oox *.
294294
Qed.
295295

296+
Lemma set_itv_splitU a b (c : T) : c \in Interval a b ->
297+
[set` Interval a b] `\ c =
298+
[set` Interval a (BLeft c)] `|` [set` Interval (BRight c) b].
299+
Proof.
300+
move=> cab; apply/seteqP; split => [x /= [xab /eqP]|x[|]]/=.
301+
- rewrite neq_lt => /orP[xc|cx]; [left|right].
302+
+ move: cab xab; rewrite !itv_boundlr => /andP[ac cb] /andP[ax xb].
303+
by rewrite ax/= bnd_simp.
304+
+ move: cab xab; rewrite !itv_boundlr => /andP[ac cb] /andP[ax xb].
305+
by rewrite xb andbT bnd_simp.
306+
- move: cab; rewrite !itv_boundlr => /andP[ac cb] /andP[ax].
307+
rewrite bnd_simp => xc.
308+
rewrite ax/= (le_trans _ cb) ?bnd_simp ?(ltW xc)//; split => //.
309+
by apply/eqP; rewrite lt_eqF.
310+
- move: cab; rewrite !itv_boundlr => /andP[ac cb] /andP[+ xb].
311+
rewrite bnd_simp => cx.
312+
rewrite xb/= andbT (le_trans ac)/= ?bnd_simp ?(ltW cx)//; split => //.
313+
by apply/eqP; rewrite gt_eqF.
314+
Qed.
315+
296316
End set_itv_orderType.
297317

298318
Lemma set_itv_ge disp [T : porderType disp] [b1 b2 : itv_bound T] :

theories/ftc.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ have /ifab : (mu `[a, c] < d%:E)%E.
521521
move=> /(_ (measurable_itv _)) {ifab}.
522522
apply: le_lt_trans.
523523
have acbc : `[a, c] `<=` `[a, b].
524-
by apply: subset_itvl; rewrite bnd_simp; move: ac; near: c; exact: nbhs_le.
524+
apply: subset_itvl; rewrite bnd_simp; move: ac; near: c.
525+
exact: lt_nbhsl_le.
525526
rewrite -lee_fin fineK; last first.
526527
apply: integral_fune_fin_num => //=.
527528
rewrite (_ : (fun _ => _) = abse \o ((EFin \o f) \_ `[a, b])); last first.

theories/normedtype.v

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,10 +1198,10 @@ Arguments cvgr0_norm_le {_ _ _ F FF}.
11981198
H : x \is_near _ |- _ => near: x; exact: cvgr0_norm_le end : core.
11991199

12001200
Section nbhs_lt_le.
1201-
Context {R : realType}.
1201+
Context {R : numFieldType}.
12021202
Implicit Types x z : R.
12031203

1204-
Lemma nbhs_lt x z : x < z -> \forall y \near x, x <= y -> y < z.
1204+
Lemma lt_nbhsl_lt x z : x < z -> \forall y \near x, x <= y -> y < z.
12051205
Proof.
12061206
move=> xz; near=> y.
12071207
rewrite le_eqVlt => /predU1P[<-//|].
@@ -1210,12 +1210,27 @@ move=> y/= /[swap] xy; rewrite ltr0_norm ?subr_lt0//.
12101210
by rewrite opprD addrC ltrBlDr subrK opprK.
12111211
Unshelve. all: by end_near. Qed.
12121212

1213-
Lemma nbhs_le x z : x < z -> \forall y \near x, x <= y -> y <= z.
1213+
Lemma lt_nbhsl_le x z : x < z -> \forall y \near x, x <= y -> y <= z.
12141214
Proof.
1215-
by move=> xz; apply: filterS (nbhs_lt xz) => y /[apply] /ltW.
1215+
by move=> xz; apply: filterS (lt_nbhsl_lt xz) => y /[apply] /ltW.
12161216
Qed.
12171217

12181218
End nbhs_lt_le.
1219+
(*#[deprecated(since="mathcomp-analysis 1.9.0", note="use `lt_nbhsl_lt` instead")]
1220+
Notation nbhs_lt := lt_nbhsl_lt (only parsing).
1221+
#[deprecated(since="mathcomp-analysis 1.9.0", note="use `lt_nbhsl_le` instead")]
1222+
Notation nbhs_le := lt_nbhsl_le (only parsing).*)
1223+
1224+
Lemma lt_nbhsr {R : realFieldType} (a z : R) : a < z ->
1225+
\forall x \near z, a < x.
1226+
Proof.
1227+
rewrite -subr_gt0 => za0; exists (z - a) => //= u/=.
1228+
rewrite ltrBrDl addrC -ltrBrDl => /lt_le_trans; apply.
1229+
rewrite lerBlDl.
1230+
have [uz|uz] := leP u z.
1231+
by rewrite ger0_norm ?subr_ge0// subrK.
1232+
by rewrite ltr0_norm ?subr_lt0// opprB addrAC -lerBlDr opprK lerD// ?ltW.
1233+
Qed.
12191234

12201235
Section open_closed_sets.
12211236
(* TODO: duplicate theory within the subspace topology of Num.real

theories/realfun.v

Lines changed: 4 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ From mathcomp Require Import sequences real_interval.
1212
(* # Real-valued functions over reals *)
1313
(* *)
1414
(* This file provides properties of standard real-valued functions over real *)
15-
(* numbers (e.g., the continuity of the inverse of a continuous function). *)
15+
(* numbers (e.g., the continuity of the inverse of a continuous function, *)
16+
(* L'Hopital's rule). *)
1617
(* *)
1718
(* ``` *)
1819
(* nondecreasing_fun f == the function f is non-decreasing *)
@@ -41,9 +42,6 @@ From mathcomp Require Import sequences real_interval.
4142
(* lime_sup f a/lime_inf f a == limit sup/inferior of the extended real- *)
4243
(* valued function f at point a *)
4344
(* ``` *)
44-
(* cauchy_MVT == Cauchy's mean value theorem *)
45-
(* lhopital_right == L'Hopital rule (limit taken on the right) *)
46-
(* lhopital_left == L'Hopital rule (limit taken on the left) *)
4745
(* *)
4846
(* Discontinuities: *)
4947
(* ``` *)
@@ -2875,6 +2873,7 @@ Unshelve. all: end_near. Qed.
28752873

28762874
End discontinuity_countable.
28772875

2876+
(** Cauchy's mean value theorem *)
28782877
Section Cauchy_MVT.
28792878
Context {R : realType}.
28802879
Variables (f df g dg : R -> R) (a b c : R).
@@ -2970,22 +2969,6 @@ by apply: DeriveDef => //; exact: near_eq_derivable fav.
29702969
Qed.
29712970
(* /NB: PR in progress *)
29722971

2973-
(* TODO: rename, move *)
2974-
Lemma nbhs_lt' {R : realType} (a z : R) : a < z -> \forall x \near nbhs z, a < x.
2975-
Proof.
2976-
rewrite -subr_gt0 => za0.
2977-
exists (z - a) => //=.
2978-
move=> u/=.
2979-
rewrite ltrBrDl addrC -ltrBrDl.
2980-
move=> /lt_le_trans; apply.
2981-
rewrite lerBlDl.
2982-
have [uz|uz] := leP u z.
2983-
rewrite ger0_norm ?subr_ge0//.
2984-
by rewrite subrK.
2985-
rewrite ltr0_norm ?subr_lt0//.
2986-
by rewrite opprB addrAC -lerBlDr opprK lerD// ?ltW.
2987-
Qed.
2988-
29892972
Section lhopital_at_right.
29902973
Context {R : realType}.
29912974
Variables (f df g dg : R -> R) (a b : R) (l : R) (ab : a < b).
@@ -3034,7 +3017,7 @@ Proof.
30343017
move=> yb zay; apply: (@near_eq_is_derive _ _ _ g) => //; last first.
30353018
by apply: gdg; move: z zay; apply: subset_itvSoo; rewrite bnd_simp.
30363019
near=> u do rewrite /g0 gt_eqF//.
3037-
by move: zay; rewrite in_itv/= => /andP[+ _]; exact: nbhs_lt'.
3020+
by move: zay; rewrite in_itv/= => /andP[+ _]; exact: lt_nbhsr.
30383021
Unshelve. all: by end_near. Qed.
30393022

30403023
Let wcont_g0 y : a < y -> y < b -> {within `[a, y], continuous g0}.
@@ -3221,28 +3204,6 @@ Unshelve. all: by end_near. Qed.
32213204

32223205
End lhopital_at_left.
32233206

3224-
(* TODO: move *)
3225-
Lemma set_itv_splitU {R : realType} (a b : itv_bound R) (c : R) :
3226-
c \in Interval a b ->
3227-
[set` Interval a b] `\ c =
3228-
[set` Interval a (BLeft c)] `|` [set` Interval (BRight c) b].
3229-
Proof.
3230-
move=> cab; apply/seteqP; split => [x /= [xab /eqP]|x[|]]/=.
3231-
- rewrite neq_lt => /orP[xc|cx]; [left|right].
3232-
+ move: cab xab; rewrite !itv_boundlr=> /andP[ac cb] /andP[ax xb].
3233-
by rewrite ax/= bnd_simp.
3234-
+ move: cab xab; rewrite !itv_boundlr=> /andP[ac cb] /andP[ax xb].
3235-
by rewrite xb andbT bnd_simp.
3236-
- move: cab; rewrite !itv_boundlr => /andP[ac cb] /andP[ax].
3237-
rewrite bnd_simp => xc.
3238-
rewrite ax/= (le_trans _ cb) ?bnd_simp ?(ltW xc)//; split => //.
3239-
by apply/eqP; rewrite lt_eqF.
3240-
- move: cab; rewrite !itv_boundlr => /andP[ac cb] /andP[+ xb].
3241-
rewrite bnd_simp => cx.
3242-
rewrite xb/= andbT (le_trans ac)/= ?bnd_simp ?(ltW cx)//; split => //.
3243-
by apply/eqP; rewrite gt_eqF.
3244-
Qed.
3245-
32463207
Section lhopital.
32473208
Context {R : realType}.
32483209
Variables (f df g dg : R -> R) (a b c : R) (l : R).
@@ -3275,99 +3236,3 @@ move=> fgcl; apply/cvg_at_right_left_dnbhs.
32753236
Qed.
32763237

32773238
End lhopital.
3278-
3279-
Section lhopital0.
3280-
Context {R : realType}.
3281-
Variables (f df g dg : R -> R) (a : R) (U : set R) (Ua : nbhs a U).
3282-
Hypotheses (fdf : forall x, x \in U -> is_derive x 1 f (df x))
3283-
(gdg : forall x, x \in U -> is_derive x 1 g (dg x)).
3284-
Hypotheses (fa0 : f a = 0) (ga0 : g a = 0)
3285-
(cdg : \forall x \near a^', dg x != 0).
3286-
3287-
Lemma lhopital_right (l : R) :
3288-
df x / dg x @[x --> a^'+] --> l -> f x / g x @[x --> a^'+] --> l.
3289-
Proof.
3290-
case: Ua => e/= e0 aeU.
3291-
case: cdg => d/= d0 cdg'.
3292-
pose D := minr e d.
3293-
have := @lhopital_at_right R f df g dg a (a + D).
3294-
rewrite ltrDl.
3295-
have D0 : 0 < D by rewrite lt_min e0 d0.
3296-
move=> /(_ _ D0).
3297-
have H (x : R) (G : R) : 0 < G -> x \in `]a, (a + G)%E[ -> `|a - x| < G.
3298-
move=> G0 xae.
3299-
rewrite ltr_norml; apply/andP; split.
3300-
move: xae; rewrite in_itv/= => /andP[_].
3301-
by rewrite ltrBrDl ltrBlDl addrC.
3302-
move: xae; rewrite in_itv/= => /andP[+ _].
3303-
rewrite -subr_lt0 => /lt_le_trans; apply.
3304-
exact: ltW.
3305-
apply.
3306-
- move=> x xae; apply: fdf.
3307-
rewrite inE; apply: aeU => /=; apply: H => //.
3308-
by move: x xae; apply: subset_itvl; rewrite bnd_simp lerD2l ge_min lexx.
3309-
- move=> x xae; apply: gdg.
3310-
rewrite inE; apply: aeU => /=; apply: H => //.
3311-
by move: x xae; apply: subset_itvl; rewrite bnd_simp lerD2l ge_min lexx.
3312-
- rewrite -fa0; apply: cvg_at_right_filter.
3313-
suff : {for a, continuous f} by [].
3314-
apply/differentiable_continuous/derivable1_diffP.
3315-
apply: ex_derive; apply: fdf.
3316-
rewrite inE.
3317-
by case: Ua => r /= r0; apply; rewrite /= subrr normr0.
3318-
- rewrite -ga0.
3319-
apply: cvg_at_right_filter.
3320-
suff : {for a, continuous g} by [].
3321-
apply/differentiable_continuous/derivable1_diffP.
3322-
apply: ex_derive; apply: gdg.
3323-
rewrite inE.
3324-
by case: Ua => r /= r0; apply; rewrite /= subrr normr0.
3325-
- move=> x xae; apply: cdg' => /=.
3326-
apply: H => //.
3327-
by move: x xae; apply: subset_itvl; rewrite bnd_simp lerD2l ge_min lexx orbT.
3328-
rewrite gt_eqF//.
3329-
by move: xae; rewrite in_itv/= => /andP[].
3330-
Qed.
3331-
3332-
End lhopital0.
3333-
3334-
Section lhopital1.
3335-
Context {R : realType}.
3336-
Variables (f df g dg : R -> R) (a : R) (U : set R) (Ua : nbhs a U).
3337-
Hypotheses (fdf : forall x, x \in U -> is_derive x 1 f (df x))
3338-
(gdg : forall x, x \in U -> is_derive x 1 g (dg x)).
3339-
Hypotheses (fa0 : f a = 0) (ga0 : g a = 0)
3340-
(cdg : \forall x \near a^', dg x != 0).
3341-
3342-
Lemma lhopital_left (l : R) :
3343-
df x / dg x @[x --> a^'-] --> l -> f x / g x @[x --> a^'-] --> l.
3344-
Proof.
3345-
move=> fgbl; apply/cvg_at_leftNP.
3346-
set h := (X in X x @[x --> _]).
3347-
rewrite (_ : h = (fun x => (fun y => (f \o -%R) y / (g \o -%R) y) x))//.
3348-
have := @lhopital_right R (f \o -%R) (fun x => (df (- x)) * -1)
3349-
(g \o -%R) (fun x => (dg (- x)) * -1) (- a) (-%R @` U).
3350-
apply.
3351-
- by rewrite nbhsNimage/=; exists U.
3352-
- move=> x; rewrite inE/= => -[r Ur] <-{x}.
3353-
rewrite opprK; apply: is_derive1_comp.
3354-
by rewrite opprK; apply: fdf; exact: mem_set.
3355-
- move=> x; rewrite inE/= => -[r Ur] <-{x}.
3356-
rewrite opprK; apply: is_derive1_comp.
3357-
by rewrite opprK; apply: gdg; exact: mem_set.
3358-
- by rewrite /= opprK.
3359-
- by rewrite /= opprK.
3360-
- case: cdg => e/= e0 H; near=> x.
3361-
rewrite mulrN1 oppr_eq0.
3362-
apply: H => /=.
3363-
rewrite -normrN opprB addrC.
3364-
by near: x; exists e.
3365-
rewrite eqr_oppLR.
3366-
by near: x; exact: nbhs_dnbhs_neq.
3367-
- apply/cvg_at_rightNP.
3368-
rewrite opprK/=; apply: cvg_trans fgbl.
3369-
apply: near_eq_cvg; near=> x.
3370-
by rewrite /= opprK !mulrN1 mulNr invrN mulrN opprK.
3371-
Unshelve. all: by end_near. Qed.
3372-
3373-
End lhopital1.

theories/trigo.v

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,21 +1230,3 @@ by rewrite ltrNl oppr0 divr_gt0// pi_gt0.
12301230
Qed.
12311231

12321232
End Atan.
1233-
1234-
Section lhopital_examples.
1235-
Variable R : realType.
1236-
1237-
Example cvg_mulsinV0 : sin x / x @[x --> 0^'] --> (1:R).
1238-
Proof.
1239-
apply: (@lhopital _ sin cos id 1 (-1) 1 0 1).
1240-
- by rewrite in_itv/= ltrN10 ltr01.
1241-
- rewrite -[X in _ --> X]sin0.
1242-
exact: continuous_sin.
1243-
- exact: cvg_id.
1244-
- by move=> ? _; exact: oner_neq0.
1245-
- rewrite -[X in _ --> X]cos0.
1246-
under eq_fun do rewrite invr1 mulr1.
1247-
exact: continuous_cos.
1248-
Qed.
1249-
1250-
End lhopital_examples.

0 commit comments

Comments
 (0)