@@ -632,73 +632,59 @@ move=> /inf_adherent/(_ hs)[_ [x ->]]; rewrite addrC subrK => ltFxl.
632632by exists x => //; rewrite (ge_inf hs.2)//; exists x.
633633Qed .
634634
635-
636- Lemma sup_ge0 (A : set R) : (forall x, A x -> 0 <= x) -> 0 <= sup A.
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.
637638Proof .
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.
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.
643642Qed .
644643
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.
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.
651649Qed .
652650
653- Lemma gt0_has_supZl (A : set R) (a : R) : 0 < a -> has_sup [set a * x | x in A ] -> has_sup A.
651+ Lemma gt0_has_supZl A (a : R) : 0 < a -> has_sup [set a * x | x in A ] ->
652+ has_sup A.
654653Proof .
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.
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.
661656Qed .
662- Lemma ge0_supZl (A : set R) (a : R) :
663- 0 <= a -> sup [set a * x | x in A ] = a * sup A .
657+
658+ Lemma ge0_supZl A (a : R) : 0 <= a -> sup [set a * x | x in A ] = a * sup A.
664659Proof .
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.
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.
669663 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.
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+ exact: ge0_supZl.
702688by under eq_fun do rewrite -mulr_natl.
703689Qed .
704690
0 commit comments