@@ -632,7 +632,64 @@ move=> /inf_adherent/(_ hs)[_ [x ->]]; rewrite addrC subrK => ltFxl.
632632by exists x => //; rewrite (ge_inf hs.2)//; exists x.
633633Qed .
634634
635+ (** This is a specialization of the lemma `ub_le_sup` exploiting the fact
636+ that `sup` is 0 when there is no supremum. *)
637+ Lemma sup_ge0 A : (forall x, A x -> 0 <= x) -> 0 <= sup A.
638+ Proof .
639+ move=> A0; have [->|/set0P[a Aa]] := eqVneq A set0; first by rewrite sup0.
640+ have [[_ Aub]|supA] := pselect (has_sup A); last by rewrite sup_out.
641+ by rewrite (le_trans (A0 _ Aa))// ub_le_sup.
642+ Qed .
643+
644+ Lemma has_sup_wpZl A (a : R) : 0 <= a -> has_sup A ->
645+ has_sup [set a * x | x in A ].
646+ Proof .
647+ move=> a0 [[x Ax] [b ub]]; split; first by exists (a * x), x.
648+ by exists (a * b) => _ [y Ay <-]; rewrite ler_wpM2l// ub.
649+ Qed .
650+
651+ Lemma gt0_has_supZl A (a : R) : 0 < a -> has_sup [set a * x | x in A ] ->
652+ has_sup A.
653+ Proof .
654+ move=> a0 [[_ [x Ax _]] [b ub]]; split; first by exists x.
655+ by exists (b / a) => y Ay; rewrite ler_pdivlMr// mulrC ub//; exists y.
656+ Qed .
657+
658+ Lemma ge0_supZl A (a : R) : 0 <= a -> sup [set a * x | x in A ] = a * sup A.
659+ Proof .
660+ rewrite le_eqVlt => /predU1P[<-|an0].
661+ have [->|A0] := eqVneq A set0; first by rewrite image_set0 sup0 mulr0.
662+ suff -> : [set 0 * x | x in A] = [set 0] by rewrite sup1 mul0r.
663+ under eq_fun do rewrite mul0r.
664+ by rewrite set_cst (negbTE A0).
665+ have [->|A0] := eqVneq A set0; first by rewrite image_set0 sup0 mulr0.
666+ have [[[x Ax] ubA]|not_ex_sup] := pselect (has_sup A); last first.
667+ rewrite !sup_out ?mulr0//.
668+ by apply: contra_not not_ex_sup; exact: gt0_has_supZl.
669+ apply/eqP; rewrite eq_le; apply/andP; split.
670+ apply: ge_sup; first by exists (a * x), x.
671+ by move=> _ [x0 Axo <-]; rewrite ler_pM2l// ub_le_sup.
672+ rewrite -ler_pdivlMl// ge_sup//; first exact/set0P.
673+ move=> x0 Ax0; rewrite ler_pdivlMl// ub_le_sup//; last by exists x0.
674+ have [x1 ubx1] := ubA.
675+ by exists (a * x1) => _ [x2 Ax2 <-]; rewrite ler_pM2l// ubx1.
676+ Qed .
677+
678+ Lemma has_sup_Mn A n : has_sup A -> has_sup [set x *+n | x in A].
679+ Proof .
680+ move=> [[x Ax] [y Ay]]; split; first by exists (x *+ n), x.
681+ by exists (y *+ n) => _ [y0 Ay0 <-]; rewrite lerMn2r Ay// orbT.
682+ Qed .
683+
684+ Lemma sup_Mn A n : sup [set x *+n | x in A ] = sup A *+ n.
685+ Proof .
686+ rewrite -mulr_natl (_ : [set _ | _ in _] = [set n%:R * x | x in A]).
687+ by under eq_fun do rewrite -mulr_natl.
688+ exact: ge0_supZl.
689+ Qed .
690+
635691End Sup.
692+
636693#[deprecated(since="mathcomp-analysis 1.14.0", note="Renamed `inf_le`.")]
637694Notation le_inf := inf_le (only parsing).
638695#[deprecated(since="mathcomp-analysis 1.14.0", note="Renamed `sup_le`.")]
0 commit comments