Skip to content

Commit c90bc25

Browse files
committed
fix
1 parent 560dcfc commit c90bc25

File tree

1 file changed

+48
-37
lines changed

1 file changed

+48
-37
lines changed

theories/realfun.v

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Unshelve. all: by end_near. Qed.
239239
$]a, +\infty[$, $]a, b[$, or $]a, b]$. *)
240240
Lemma nonincreasing_at_right_cvgr (f : R -> R) a (b : itv_bound R) :
241241
(BRight a < b)%O ->
242-
{in Interval (BRight a) b, nonincreasing_fun f} ->
242+
{in Interval (BRight a) b &, nonincreasing_fun f} ->
243243
has_ubound (f @` [set` Interval (BRight a) b]) ->
244244
f x @[x --> a ^'+] --> sup (f @` [set` Interval (BRight a) b]).
245245
Proof.
@@ -253,51 +253,54 @@ have supf : has_sup [set f x | x in [set` Interval (BRight a) b]].
253253
- by exists (f (a + 1)), (a + 1).
254254
- by exists (f (a + 1)), (a + 1) => //=; rewrite in_itv/= ltr_addl andbT.
255255
apply/cvgrPdist_le => _/posnumP[e].
256-
have {supf} [p ap] : exists2 p, a < p & M - e%:num <= f p.
257-
have [_ -[p ap] <- /ltW efp] := sup_adherent (gt0 e) supf.
258-
exists p; last by rewrite efp.
259-
by move: ap; rewrite /= in_itv/= -[X in _ && X]/(BLeft p < b)%O => /andP[].
256+
have {supf} [p [ap pb]] : exists p, [/\ (a < p), (BLeft p < b)%O & M - e%:num <= f p].
257+
have [_ -[p apb] <- /ltW efp] := sup_adherent (gt0 e) supf.
258+
move: apb.
259+
rewrite /= in_itv/= -[X in _ && X]/(BLeft p < b)%O => /andP[ap pb].
260+
by exists p; split.
260261
rewrite ler_subl_addr {}/M.
261-
move: b ab lef ubf => [[|] b|[//|]] ab lef ubf; set M := sup _ => Mefp.
262+
move: b ab pb lef ubf => [[|] b|[//|]] ab pb lef ubf; set M := sup _ => Mefp.
262263
- near=> r; rewrite ler_distl; apply/andP; split.
263264
+ suff: f r <= M by apply: le_trans; rewrite ler_subl_addr ler_addl.
264265
apply: sup_ub => //=; exists r => //; rewrite in_itv/=.
265266
by apply/andP; split; near: r; [exact: nbhs_right_gt|exact: nbhs_right_lt].
266-
+ rewrite (le_trans Mefp)// ler_add2r lef//=; last first.
267+
+ rewrite (le_trans Mefp)// ler_add2r lef//=; last 2 first.
268+
by rewrite in_itv/= ap.
267269
by near: r; exact: nbhs_right_le.
268-
rewrite in_itv/=.
269-
by apply/andP; split; near: r; [exact: nbhs_right_gt|exact: nbhs_right_lt].
270+
apply/andP; split; near: r; [exact: nbhs_right_gt|exact: nbhs_right_lt].
270271
- near=> r; rewrite ler_distl; apply/andP; split.
271272
+ suff: f r <= M by apply: le_trans; rewrite ler_subl_addr ler_addl.
272273
apply: sup_ub => //=; exists r => //; rewrite in_itv/=.
273274
by apply/andP; split; near: r; [exact: nbhs_right_gt|exact: nbhs_right_le].
274-
+ rewrite (le_trans Mefp)// ler_add2r lef//=; last first.
275+
+ rewrite (le_trans Mefp)// ler_add2r lef//=; last 2 first.
276+
by rewrite in_itv/= ap.
275277
by near: r; exact: nbhs_right_le.
276278
by apply/andP; split; near: r; [exact: nbhs_right_gt|exact: nbhs_right_le].
277279
- near=> r; rewrite ler_distl; apply/andP; split.
278280
suff: f r <= M by apply: le_trans; rewrite ler_subl_addr ler_addl.
279281
apply: sup_ub => //=; exists r => //; rewrite in_itv/= andbT.
280282
by near: r; apply: nbhs_right_gt.
281283
rewrite (le_trans Mefp)// ler_add2r lef//.
282-
by rewrite in_itv/= andbT; near: r; exact: nbhs_right_gt.
283-
by near: r; exact: nbhs_right_le.
284+
- by rewrite in_itv/= andbT; near: r; exact: nbhs_right_gt.
285+
- by rewrite in_itv/= ap.
286+
- by near: r; exact: nbhs_right_le.
284287
Unshelve. all: by end_near. Qed.
285288

286289
Lemma nondecreasing_at_right_cvgr (f : R -> R) a (b : itv_bound R) :
287290
(BRight a < b)%O ->
288-
{in Interval (BRight a) b, nondecreasing_fun f} ->
291+
{in Interval (BRight a) b &, nondecreasing_fun f} ->
289292
has_lbound (f @` [set` Interval (BRight a) b]) ->
290293
f x @[x --> a ^'+] --> inf (f @` [set` Interval (BRight a) b]).
291294
Proof.
292295
move=> ab nif hlb; set M := inf _.
293-
have ndNf : {in Interval (BRight a) b, nonincreasing_fun (\- f)}.
294-
by move=> r ra y /nif; rewrite ler_opp2; exact.
296+
have ndNf : {in Interval (BRight a) b &, nonincreasing_fun (\- f)}.
297+
by move=> r s rab sab /nif; rewrite ler_opp2; exact.
295298
have hub : has_ubound [set (\- f) x | x in [set` Interval (BRight a) b]].
296299
apply/has_ub_lbN; rewrite image_comp/=.
297-
rewrite [X in has_lbound X](_ : _ = [set f x | x in [set` Interval (BRight a) b]])//.
300+
rewrite [X in has_lbound X](_ : _ = f @` [set` Interval (BRight a) b])//.
298301
by apply: eq_imagel => y _ /=; rewrite opprK.
299302
have /cvgN := nonincreasing_at_right_cvgr ab ndNf hub.
300-
rewrite opprK [X in _ --> X -> _](_ : _ = inf [set f x | x in [set` Interval (BRight a) b]])//.
303+
rewrite opprK [X in _ --> X -> _](_ : _ = inf (f @` [set` Interval (BRight a) b]))//.
301304
by rewrite /inf; congr (- sup _); rewrite image_comp/=; exact: eq_imagel.
302305
Qed.
303306

@@ -397,7 +400,7 @@ Proof. by move=> u_nd u_ub; apply: cvgP; exact: nondecreasing_cvge. Qed.
397400

398401
Lemma nondecreasing_at_right_cvge (f : R -> \bar R) a (b : itv_bound R) :
399402
(BRight a < b)%O ->
400-
{in Interval (BRight a) b, nondecreasing_fun f} ->
403+
{in Interval (BRight a) b &, nondecreasing_fun f} ->
401404
f x @[x --> a ^'+] --> ereal_inf (f @` [set` Interval (BRight a) b]).
402405
Proof.
403406
move=> ab ndf; set S := (X in ereal_inf X); set l := ereal_inf S.
@@ -407,7 +410,8 @@ have [Snoo|Snoo] := pselect (S -oo).
407410
have Nf n : (a < n <= N)%R -> f n = -oo.
408411
move=> /andP[an nN]; apply/eqP.
409412
rewrite eq_le leNye andbT -fNpoo ndf//.
410-
by rewrite in_itv/= -[X in _ && X]/(BLeft n < b)%O an (le_lt_trans _ Nb).
413+
by rewrite in_itv/= -[X in _ && X]/(BLeft n < b)%O an (le_lt_trans _ Nb).
414+
by rewrite in_itv/= -[X in _ && X]/(BLeft N < b)%O (lt_le_trans an nN).
411415
have -> : l = -oo.
412416
by rewrite /l /ereal_inf /ereal_sup supremum_pinfty//=; exists -oo.
413417
apply: cvg_near_cst; exists (N - a)%R => /=; first by rewrite subr_gt0.
@@ -421,7 +425,8 @@ have [lnoo|lnoo] := eqVneq l -oo.
421425
move=> z /= + az.
422426
rewrite ltr0_norm ?subr_lt0// opprB ltr_subl_addr subrK => zy.
423427
rewrite (le_trans _ (ltW fyM))// ndf ?ltW//.
424-
by rewrite in_itv/= -[X in _ && X]/(BLeft z < b)%O/= az/= (lt_trans _ yb).
428+
by rewrite in_itv/= -[X in _ && X]/(BLeft z < b)%O/= az/= (lt_trans _ yb).
429+
by rewrite in_itv/= -[X in _ && X]/(BLeft y < b)%O/= (lt_trans az zy).
425430
have [fpoo|fpoo] := pselect {in Interval (BRight a) b, forall x, f x = +oo}.
426431
rewrite {}/l in lnoo *; rewrite {}/S in Snoo lnoo *.
427432
rewrite [X in ereal_inf X](_ : _ = [set +oo]).
@@ -457,6 +462,7 @@ have axA r : (a < r <= x)%R -> r \in A.
457462
apply/negP => /eqP urnoo.
458463
move: rafx; rewrite urnoo.
459464
rewrite in_itv/= -[X in _ && X]/(BLeft r < b)%O ar/=.
465+
rewrite in_itv/= -[X in _ && X]/(BLeft x < b)%O ax/=.
460466
by rewrite leye_eq (negbTE fxpoo) -falseE; apply; rewrite (le_lt_trans _ xb).
461467
rewrite -(@fineK _ l)//; apply/fine_cvgP; split.
462468
exists (x - a)%R => /=; first by rewrite subr_gt0.
@@ -509,7 +515,8 @@ have <- : inf [set g x | x in [set` Interval (BRight a) b]] = fine l.
509515
apply: ereal_inf_lb => /=; exists (fine (f m)); last first.
510516
by rewrite fineK// f_fin_num// axA// am (ltW mx).
511517
by exists m; [rewrite in_itv/= am|rewrite /g am mx].
512-
rewrite (le_trans _ (ndf _ _ _ xm))//; last by rewrite in_itv/= ax.
518+
rewrite (@le_trans _ _ (f x))//; last first.
519+
by apply: ndf => //; rewrite in_itv//= ?ax ?am.
513520
apply: ereal_inf_lb => /=; exists (fine (f x)); last first.
514521
by rewrite fineK// f_fin_num ?inE.
515522
by exists x; [rewrite in_itv/= ax|rewrite /g ltxx andbF].
@@ -526,17 +533,22 @@ suff: g x @[x --> a^'+] --> inf [set g x | x in [set` Interval (BRight a) b]].
526533
rewrite ltr0_norm// ?subr_lt0// opprB ltr_subl_addr => /lt_le_trans; apply.
527534
by rewrite -ler_subr_addr ler_pdivr_mulr// ler_pmulr// ?ler1n// subr_gt0.
528535
apply: nondecreasing_at_right_cvgr => //.
529-
- move=> m ma n mn /=; rewrite /g /=; case: ifPn => [/andP[am mx]|].
536+
- move=> m n; rewrite !in_itv/= -[X in _ && X]/(BLeft m < b)%O.
537+
rewrite -[X in _ -> _ && X -> _]/(BLeft n < b)%O.
538+
move=> /andP[am mb] /andP[an nb] mn.
539+
rewrite /g /=; case: ifPn => [/andP[_ mx]|].
530540
rewrite (lt_le_trans am mn) /=; have [nx|nn0] := ltP n x.
531541
rewrite fine_le ?f_fin_num ?ndf//; first by rewrite axA// am (ltW mx).
532542
by rewrite axA// (ltW nx) andbT (lt_le_trans am).
543+
by rewrite in_itv/= am.
544+
by rewrite in_itv/= an.
533545
rewrite fine_le ?f_fin_num//.
534546
+ by rewrite axA// am (ltW (lt_le_trans mx _)).
535547
+ by rewrite inE.
536-
+ by rewrite ndf// ltW.
537-
rewrite negb_and -!leNgt => /orP[ma'|xm].
538-
by move: ma; rewrite in_itv/= ltNge ma'.
539-
move: ma; rewrite in_itv/= => /andP[am mb].
548+
+ rewrite ndf//; last exact/ltW.
549+
by rewrite !in_itv/= am.
550+
by rewrite !in_itv/= ax.
551+
rewrite negb_and -!leNgt => /orP[|xm]; first by rewrite leNgt am.
540552
by rewrite (lt_le_trans am mn)/= ltNge (le_trans xm mn).
541553
- exists (fine l) => /= _ [m _ <-]; rewrite /g /=.
542554
rewrite -lee_fin (fineK l_fin_num); apply: ereal_inf_lb.
@@ -551,18 +563,17 @@ apply: nondecreasing_at_right_cvgr => //.
551563
Unshelve. all: by end_near. Qed.
552564

553565
Lemma nondecreasing_at_right_is_cvge (f : R -> \bar R) a (b : itv_bound R) :
554-
(BRight a < b)%O -> {in Interval (BRight a) b, nondecreasing_fun f} ->
566+
(BRight a < b)%O -> {in Interval (BRight a) b &, nondecreasing_fun f} ->
555567
cvg (f x @[x --> a ^'+]).
556568
Proof. by move=> h ?; apply: cvgP; exact: (nondecreasing_at_right_cvge h). Qed.
557569

558570
Lemma nonincreasing_at_right_cvge (f : R -> \bar R) a (b : itv_bound R) :
559-
(BRight a < b)%O -> {in Interval (BRight a) b, nonincreasing_fun f} ->
571+
(BRight a < b)%O -> {in Interval (BRight a) b &, nonincreasing_fun f} ->
560572
f x @[x --> a ^'+] --> ereal_sup (f @` [set` Interval (BRight a) b]).
561573
Proof.
562574
move=> ab nif.
563-
have ndNf :
564-
{in Interval (BRight a) b, {homo (\- f) : n m / (n <= m)%R >-> n <= m}}.
565-
by move=> r ra y /nif; rewrite leeN2; exact.
575+
have ndNf : {in Interval (BRight a) b &, {homo (\- f) : n m / (n <= m)%R >-> n <= m}}.
576+
by move=> r s rab sab /nif; rewrite leeN2; exact.
566577
have /cvgeN := nondecreasing_at_right_cvge ab ndNf.
567578
under eq_fun do rewrite oppeK.
568579
set lhs := (X in _ --> X -> _); set rhs := (X in _ -> _ --> X).
@@ -572,7 +583,7 @@ by rewrite image_comp/=; apply: eq_imagel => x _ /=; rewrite oppeK.
572583
Qed.
573584

574585
Lemma nonincreasing_at_right_is_cvge (f : R -> \bar R) a (b : itv_bound R) :
575-
(BRight a < b)%O -> {in Interval (BRight a) b, nonincreasing_fun f} ->
586+
(BRight a < b)%O -> {in Interval (BRight a) b &, nonincreasing_fun f} ->
576587
cvg (f x @[x --> a ^'+]).
577588
Proof. by move=> h ?; apply: cvgP; exact: (nonincreasing_at_right_cvge h). Qed.
578589

@@ -605,7 +616,7 @@ Qed.
605616
Let sup_ball_is_cvg f a : cvg (sup_ball f a e @[e --> 0^'+]).
606617
Proof.
607618
apply: (nondecreasing_at_right_is_cvge +oo)%O => //=.
608-
by move=> x; rewrite in_itv/= andbT => x0 y /sup_ball_le.
619+
by move=> x y; rewrite !in_itv/= !andbT => x0 y0 /sup_ball_le.
609620
Qed.
610621

611622
Let inf_ball f a r := - sup_ball (\- f) a r.
@@ -621,7 +632,7 @@ Proof. by move=> sr; rewrite /inf_ball lee_oppl oppeK sup_ball_le. Qed.
621632
Let inf_ball_is_cvg f a : cvg (inf_ball f a e @[e --> 0^'+]).
622633
Proof.
623634
apply: (nonincreasing_at_right_is_cvge +oo)%O => //.
624-
by move=> x; rewrite in_itv/= andbT => x0 y /inf_ball_le.
635+
by move=> x y; rewrite !in_itv/= !andbT => x0 y0 /inf_ball_le.
625636
Qed.
626637

627638
Let le_sup_ball f g a :
@@ -656,7 +667,7 @@ Lemma lime_supE f a :
656667
Proof.
657668
rewrite lime_sup_lim; apply/cvg_lim => //.
658669
apply: nondecreasing_at_right_cvge => //.
659-
by move=> x; rewrite in_itv/= andbT => x0 y; exact: sup_ball_le.
670+
by move=> x y; rewrite !in_itv/= !andbT => x0 y0; exact: sup_ball_le.
660671
Qed.
661672

662673
Lemma lime_infE f a :
@@ -693,8 +704,8 @@ Proof.
693704
move=> fg; rewrite !lime_sup_lim -limeD//; last first.
694705
by rewrite -!lime_sup_lim.
695706
apply: lee_lim => //.
696-
- apply: (nondecreasing_at_right_is_cvge +oo)%O => //= x.
697-
by rewrite in_itv/= andbT => x0 y xy; rewrite lee_add//; exact: sup_ball_le.
707+
- apply: (nondecreasing_at_right_is_cvge +oo)%O => //= x y.
708+
by rewrite !in_itv/= !andbT => x0 y0 xy; rewrite lee_add//; exact: sup_ball_le.
698709
- near=> a0; apply: ub_ereal_sup => _ /= [a1 [a1ae a1a]] <-.
699710
by apply: lee_add; apply: ereal_sup_ub => /=; exists a1.
700711
Unshelve. all: by end_near. Qed.

0 commit comments

Comments
 (0)