Skip to content

Commit 0dda958

Browse files
affeldt-aistMarie Kerjeanadjevahi
authored
variants of {sup,inf}_le (#2021)
- le_supP and gt_sup Co-authored-by: Marie Kerjean <marie.kerjean@cnrs.fr> Co-authored-by: adjevahi <arthur.djevahirdjian@ens-lyon.fr>
1 parent a912420 commit 0dda958

7 files changed

Lines changed: 65 additions & 23 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@
284284
- in `pseudometric_normed_Zmodule.v`:
285285
+ factory `isPseudoMetricNormedZmodule`
286286
+ structure `PseudoMetricNormedZmod0`
287+
- in `reals.v`:
288+
+ lemmas `supS`, `infS`
289+
+ lemmas `ge0_infZl`, `inf_ge0`, `inf_pos`
290+
+ lemmas `le_supP`, `gt_sup`
287291

288292
### Changed
289293

reals/reals.v

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ From HB Require Import structures.
4747
From mathcomp Require Import boot order algebra.
4848
#[warning="-warn-library-file-internal-analysis"]
4949
From mathcomp Require Import unstable.
50-
From mathcomp Require Import mathcomp_extra boolp classical_sets set_interval.
50+
From mathcomp Require Import mathcomp_extra boolp classical_sets contra
51+
set_interval.
5152

5253
Declare Scope real_scope.
5354

@@ -647,13 +648,35 @@ move=> SBA AB Ai; rewrite lerNl opprK sup_le// ?has_inf_supN//.
647648
exact/nonemptyN.
648649
Qed.
649650

651+
Lemma supS A B : A !=set0 -> has_sup B -> A `<=` B -> sup A <= sup B.
652+
Proof.
653+
by move=> ? ? AB; apply: sup_le => //; apply: (subset_trans AB (@le_down _)).
654+
Qed.
655+
656+
Lemma infS A B : has_inf A -> B !=set0 -> B `<=` A -> inf A <= inf B.
657+
Proof.
658+
by move=> infA B0 AB; rewrite /inf lerN2 supS//;
659+
[exact/nonemptyN|exact/has_inf_supN|exact/image_subset].
660+
Qed.
661+
662+
Lemma le_supP A x : has_sup A -> sup A <= x <-> ubound A x.
663+
Proof.
664+
move=> hsA; split=> [? ? ?|Ax]; first exact: (le_trans (sup_upper_bound hsA _)).
665+
by apply: ge_sup => //; apply/set0P; contra: (@has_sup0 _ R) => <-.
666+
Qed.
667+
668+
Lemma gt_sup A x : has_sup A -> sup A < x -> forall y, A y -> y < x.
669+
Proof.
670+
by move=> hsA sAx y Ay; apply: le_lt_trans sAx; exact: sup_upper_bound.
671+
Qed.
672+
650673
Lemma sup_down A : sup (down A) = sup A.
651674
Proof.
652675
have [supA|supNA] := pselect (has_sup A); last first.
653676
by rewrite !sup_out // => /has_sup_down.
654677
have supDA : has_sup (down A) by apply/has_sup_down.
655678
apply/eqP; rewrite eq_le !sup_le //.
656-
- by case: supA => -[x xA] _; exists x; apply/le_down.
679+
- by case: supA => -[x xA] _; exists x; exact/le_down.
657680
- by rewrite downK; exact: le_down.
658681
- by case: supA.
659682
Qed.
@@ -687,6 +710,12 @@ have [[_ Aub]|supA] := pselect (has_sup A); last by rewrite sup_out.
687710
by rewrite (le_trans (A0 _ Aa))// ub_le_sup.
688711
Qed.
689712

713+
Lemma inf_ge0 A : (forall x, A x -> 0 <= x) -> 0 <= inf A.
714+
Proof.
715+
move=> BA; have [->|A0] := eqVneq A set0; first by rewrite inf0.
716+
by apply: lb_le_inf => //; exact/set0P.
717+
Qed.
718+
690719
Lemma has_sup_wpZl A (a : R) : 0 <= a -> has_sup A ->
691720
has_sup [set a * x | x in A ].
692721
Proof.
@@ -701,7 +730,7 @@ move=> a0 [[_ [x Ax _]] [b ub]]; split; first by exists x.
701730
by exists (b / a) => y Ay; rewrite ler_pdivlMr// mulrC ub//; exists y.
702731
Qed.
703732

704-
Lemma ge0_supZl A (a : R) : 0 <= a -> sup [set a * x | x in A ] = a * sup A.
733+
Lemma ge0_supZl A (a : R) : 0 <= a -> sup [set a * x | x in A ] = a * sup A.
705734
Proof.
706735
rewrite le_eqVlt => /predU1P[<-|an0].
707736
have [->|A0] := eqVneq A set0; first by rewrite image_set0 sup0 mulr0.
@@ -721,6 +750,20 @@ have [x1 ubx1] := ubA.
721750
by exists (a * x1) => _ [x2 Ax2 <-]; rewrite ler_pM2l// ubx1.
722751
Qed.
723752

753+
Lemma ge0_infZl A (a : R) : 0 <= a -> inf [set a * x | x in A] = a * inf A.
754+
Proof.
755+
move=> a0; rewrite /inf mulrN -(ge0_supZl (-%R @` A) a0); congr (- sup _).
756+
by rewrite !image_comp/=; apply: eq_imagel => //= ? _; rewrite mulrN.
757+
Qed.
758+
759+
Lemma inf_pos : inf [set r : R | 0 < r] = 0.
760+
Proof.
761+
apply/eqP; rewrite eq_le; apply/andP; split; last first.
762+
by apply: inf_ge0 => x /ltW.
763+
apply/ler_addgt0Pr => e e0; rewrite add0r; apply: ge_inf => //=.
764+
by exists 0 => r /ltW.
765+
Qed.
766+
724767
Lemma has_sup_Mn A n : has_sup A -> has_sup [set x *+n | x in A].
725768
Proof.
726769
move=> [[x Ax] [y Ay]]; split; first by exists (x *+ n), x.

theories/lebesgue_measure.v

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,14 @@ have [J0|/set0P J0] := eqVneq J set0.
144144
move=> /subset_itvP ij; apply: leeB => /=.
145145
have [ui|ui] := asboolP (has_ubound I).
146146
have [uj /=|uj] := asboolP (has_ubound J); last by rewrite leey.
147-
by rewrite lee_fin sup_le // => r Ir; exists r; split => //; apply: ij.
147+
by rewrite lee_fin supS.
148148
have [uj /=|//] := asboolP (has_ubound J).
149149
by move: ui; have := subset_has_ubound ij uj.
150150
have [lj /=|lj] := asboolP (has_lbound J); last by rewrite leNye.
151151
have [li /=|li] := asboolP (has_lbound I); last first.
152152
by move: li; have := subset_has_lbound ij lj.
153-
rewrite lee_fin lerNl opprK sup_le// ?has_inf_supN//; last exact/nonemptyN.
154-
move=> r [r' Ir' <-{r}]; exists (- r')%R.
155-
by split => //; exists r' => //; apply: ij.
153+
rewrite lee_fin lerNl opprK supS// ?has_inf_supN//; first exact/nonemptyN.
154+
by move=> r/= [s Is <-]; exists s => //; exact: ij.
156155
Qed.
157156

158157
Lemma le_hlength : {homo hlength : A B / (A `<=` B) >-> A <= B}.

theories/lebesgue_stieltjes_measure.v

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,16 +686,13 @@ have [J0|/set0P J0] := eqVneq J set0.
686686
move=> /subset_itvP ij; apply: leeB => /=.
687687
have [ui|ui] := asboolP (has_ubound I).
688688
have [uj /=|uj] := asboolP (has_ubound J); last by rewrite leey.
689-
rewrite lee_fin; apply: ndf; apply: sup_le => //.
690-
by move=> r Ir; exists r; split => //; apply: ij.
689+
by rewrite lee_fin ndf// supS.
691690
have [uj /=|//] := asboolP (has_ubound J).
692691
by move: ui; have := subset_has_ubound ij uj.
693692
have [lj /=|lj] := asboolP (has_lbound J); last by rewrite leNye.
694693
have [li /=|li] := asboolP (has_lbound I); last first.
695694
by move: li; have := subset_has_lbound ij lj.
696-
rewrite lee_fin; apply/ndf/inf_le => //.
697-
move=> r [r' Ir' <-{r}]; exists (- r')%R.
698-
by split => //; exists r' => //; apply: ij.
695+
by rewrite lee_fin; exact/ndf/infS.
699696
Qed.
700697

701698
Lemma le_wlength (ndf : {homo f : x y / (x <= y)%R}) :

theories/realfun.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,14 +2042,14 @@ rewrite ereal_sup_EFin//; first exact: variations_neq0.
20422042
rewrite -EFinD -sup_sumE.
20432043
- by split => //; exact: variations_neq0.
20442044
- by split => //; exact: variations_neq0.
2045-
apply: sup_le.
2046-
- move=> r/= [s [l' acl' <-{s}]] [t [l cbl] <-{t} <-{r}].
2047-
exists (variation a b f (l' ++ l)); split; last by rewrite -variation_cat// ltW.
2048-
exact/variations_variation/(itv_partition_cat acl' cbl).
2045+
apply: supS.
20492046
- have [r acfr] := variations_neq0 f ac.
20502047
have [s cbfs] := variations_neq0 f cb.
20512048
by exists (r + s); exists r => //; exists s.
20522049
- by split => //; apply: variations_neq0; rewrite (lt_trans ac).
2050+
- move=> r/= [s [l' acl' <-{s}]] [t [l cbl] <-{t} <-{r}].
2051+
exists (l' ++ l); last by rewrite -variation_cat// ltW.
2052+
exact/(itv_partition_cat acl' cbl).
20532053
Qed.
20542054

20552055
Let total_variationD2 a b c f : a <= c -> c <= b ->

theories/sequences.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,10 +2133,10 @@ Qed.
21332133
Lemma nonincreasing_sups u : has_ubound (range u) ->
21342134
nonincreasing_seq (sups u).
21352135
Proof.
2136-
move=> u_ub m n mn; apply: sup_le => [_ /= [p np] <-| |].
2137-
- by apply/downP; exists (u p) => //=; exists p => //; exact: leq_trans np.
2136+
move=> u_ub m n mn; apply: supS => [| |_ [p /= np] <-].
21382137
- by exists (u n) => /=; exists n => /=.
2139-
- by split; [exists (u m); exists m => //=|exact/has_ubound_sdrop].
2138+
- by split; [exists (u m); exists m => /=|exact/has_ubound_sdrop].
2139+
- by exists p => //=; exact: leq_trans np.
21402140
Qed.
21412141

21422142
Lemma nondecreasing_infs u : has_lbound (range u) ->

theories/trigo.v

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,13 +1263,12 @@ apply/eqP; rewrite eq_le; apply/andP; split; last first.
12631263
by apply: ge_sup => //; exists 0, 0 => //; exact: atan0.
12641264
have -> : pi / 2 = sup `[0, pi / 2[ :> R.
12651265
by rewrite real_interval.sup_itv// bnd_simp divr_gt0// pi_gt0.
1266-
apply: sup_le; last 2 first.
1266+
apply: supS.
12671267
- by exists 0; rewrite /= in_itv/= lexx/= divr_gt0// pi_gt0.
12681268
- split; first by exists 0, 0 => //; rewrite atan0.
12691269
by exists (pi / 2) => _ [x _ <-]; exact/ltW/atan_ltpi2.
1270-
move=> x/= /[!in_itv]/= /andP[x0 xpi2].
1271-
apply/downP; exists (atan (tan x)) => /=; first by exists (tan x).
1272-
rewrite tanK// in_itv/= xpi2 andbT (lt_le_trans _ x0)//.
1270+
move=> x/= /itvP x0pi2; exists (tan x) => //=.
1271+
rewrite tanK// in_itv/= x0pi2 andbT (@lt_le_trans _ _ 0) ?x0pi2//.
12731272
by rewrite ltrNl oppr0 divr_gt0// pi_gt0.
12741273
Qed.
12751274

0 commit comments

Comments
 (0)