Skip to content

Commit 404e307

Browse files
committed
added a few lemmas about sup
1 parent 85fa9f6 commit 404e307

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
- in `derive.v`:
7171
+ lemmas `compact_EVT_max`, `compact_EVT_min`, `EVT_max_rV`, `EVT_min_rV`
7272

73+
- in `reals.v`:
74+
+ lemmas `sup_ge0`, `has_sup_wpZl`, `gt0_has_supZl`, `has_sup_Mn`, `sup_Mn`
75+
7376
### Changed
7477

7578
- in `constructive_ereal.v`: fixed the infamous `%E` scope bug.

reals/reals.v

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,78 @@ move=> /inf_adherent/(_ hs)[_ [x ->]]; rewrite addrC subrK => ltFxl.
632632
by exists x => //; rewrite (ge_inf hs.2)//; exists x.
633633
Qed.
634634

635+
636+
Lemma sup_ge0 (A : set R) : (forall x, A x -> 0 <= x) -> 0 <= sup A.
637+
Proof.
638+
move=> Ax.
639+
have [->|/set0P[a Aa]] := eqVneq A set0; first by rewrite sup0.
640+
have [[A0 Aub]|supA] := pselect (has_sup A).
641+
by rewrite (le_trans (Ax _ Aa))// ub_le_sup.
642+
by rewrite sup_out.
643+
Qed.
644+
645+
Lemma has_sup_wpZl (A : set R) (a : R) : 0 <= a -> has_sup A -> has_sup [set a * x | x in A ].
646+
Proof.
647+
move => a0 [[x Ax] [b ub]].
648+
split;first by exists (a*x); exists x.
649+
exists (a * b) => _ [y Ay <-].
650+
by rewrite ler_wpM2l //; apply ub.
651+
Qed.
652+
653+
Lemma gt0_has_supZl (A : set R) (a : R) : 0 < a -> has_sup [set a * x | x in A ] -> has_sup A.
654+
Proof.
655+
move => a0 [[_ [x Ax _]] [b ub]].
656+
split;first by exists x.
657+
exists (b/a).
658+
move => y Ay.
659+
rewrite ler_pdivlMr // mulrC.
660+
by apply ub;exists y.
661+
Qed.
662+
Lemma ge0_supZl (A : set R) (a : R) :
663+
0 <= a -> sup [set a * x | x in A ] = a * sup A .
664+
Proof.
665+
move =>a0.
666+
have [->|an0] := eqVneq a 0.
667+
have [->| /negPf Anonempty] := eqVneq A set0; first by rewrite image_set0 sup0 mulr0.
668+
suff -> : [set 0*x | x in A] = [set 0] by rewrite sup1 mul0r.
669+
under eq_fun do rewrite mul0r.
670+
by rewrite set_cst Anonempty.
671+
have [->|/set0P Anonempty] := eqVneq A set0; first by rewrite image_set0 sup0 mulr0.
672+
have [ex_sup | not_ex_sup] := pselect (has_sup A); last by rewrite !sup_out ?mulr0 // => -h;apply not_ex_sup; apply: gt0_has_supZl h;rewrite lt0r an0.
673+
have [[x Ax] ub] := ex_sup.
674+
apply /eqP;rewrite eq_le;apply /andP;split.
675+
apply ge_sup; first by exists (a * x), x.
676+
move => _ [x0 Axo <-].
677+
by rewrite ler_wpM2l// ub_le_sup.
678+
rewrite -ler_pdivlMl; last by rewrite lt0r an0.
679+
apply ge_sup; first by apply ex_sup.
680+
move => x0 Ax0.
681+
rewrite ler_pdivlMl; last by rewrite lt0r an0.
682+
rewrite ub_le_sup //; last by exists x0.
683+
have [x1 ubx1] := ub.
684+
exists (a * x1) => _ [x2 Ax2 <-].
685+
by rewrite ler_wpM2l// ubx1.
686+
Qed.
687+
688+
Lemma has_sup_Mn (A : set R) n :
689+
has_sup A -> has_sup [set x *+n | x in A ].
690+
Proof.
691+
move => [-[] x Ax [y uby]].
692+
split; first by exists (x *+ n), x.
693+
exists (y *+ n).
694+
move => _ [y0 Ay0 <-] .
695+
by rewrite lerMn2r uby// orbT.
696+
Qed.
697+
698+
Lemma sup_Mn (A : set R) n :
699+
sup [set x *+n | x in A ] = sup A *+ n.
700+
Proof.
701+
rewrite -mulr_natl [X in sup X = _](_ : _ = [set n%:R * x | x in A]); first exact: ge0_supZl.
702+
by under eq_fun do rewrite -mulr_natl.
703+
Qed.
704+
635705
End Sup.
706+
636707
#[deprecated(since="mathcomp-analysis 1.14.0", note="Renamed `inf_le`.")]
637708
Notation le_inf := inf_le (only parsing).
638709
#[deprecated(since="mathcomp-analysis 1.14.0", note="Renamed `sup_le`.")]

0 commit comments

Comments
 (0)