intros p q pq H' H'0 H'1 H'2 H'3.
cut (Fbounded b pq);
[ intros Fb0
| apply
RoundedModeBounded
with (radix := radix) (P := Closest b radix) (r := (p + q)%R);
auto; apply ClosestRoundedModeP with (precision := precision) ];
auto.
case (Rle_or_lt 0 q); intros Rl2;
[ idtac | cut (q <= 0)%R; [ intros Rl2' | apply Rlt_le; auto ] ].
repeat rewrite Rabs_right; auto with real.
apply plusClosestLowerBoundAux1 with (q := p); auto.
rewrite <- (Rabs_right q); auto with real.
apply (ClosestCompatible b radix (p + q)%R (q + p)%R pq pq); auto; try ring.
rewrite Rplus_comm; auto with real.
apply Rle_ge; unfold FtoRradix in |- *;
apply
RleRoundedR0
with
(b := b)
(precision := precision)
(P := Closest b radix)
(r := (p + q)%R); auto.
apply ClosestRoundedModeP with (precision := precision); auto.
case (Rle_or_lt 0 p); intros Rl3;
[ idtac | cut (p <= 0)%R; [ intros Rl3' | apply Rlt_le; auto ] ];
auto with real.
replace 0%R with (0 + 0)%R; auto with real.
apply Rplus_le_reg_l with (r := (- p)%R).
replace (- p + 0)%R with (- p)%R; [ idtac | ring ].
replace (- p + (p + q))%R with (FtoRradix q); [ idtac | ring ].
rewrite <- (Faux.Rabsolu_left1 (FtoRradix p)); auto with real.
rewrite <- (Rabs_right (FtoRradix q)); auto with real.
repeat rewrite Faux.Rabsolu_left1; auto with real.
unfold FtoRradix in |- *; repeat rewrite <- (Fopp_correct 2%nat); auto.
apply plusClosestLowerBoundAux1 with (q := Fopp p); auto.
unfold FtoRradix in |- *; repeat rewrite Fopp_correct; rewrite Rabs_Ropp;
rewrite <- Faux.Rabsolu_left1; auto with real.
apply
(ClosestCompatible b radix (- (p + q))%R (Fopp q + Fopp p)%R (
Fopp pq) (Fopp pq)); auto.
apply ClosestOpp; auto.
unfold FtoRradix in |- *; repeat rewrite Fopp_correct; ring.
apply oppBounded; auto.
apply oppBounded; auto.
apply oppBounded; auto.
unfold FtoRradix in |- *; repeat rewrite Fopp_correct; Contradict H'2.
unfold FtoRradix in |- *; rewrite <- (Ropp_involutive (FtoR radix pq));
rewrite H'2; ring.
unfold FtoRradix in |- *;
apply
RleRoundedLessR0
with
(b := b)
(precision := precision)
(P := Closest b radix)
(r := (p + q)%R); auto.
apply ClosestRoundedModeP with (precision := precision); auto.
case (Rle_or_lt 0 p); intros Rl3;
[ idtac | cut (p <= 0)%R; [ intros Rl3' | apply Rlt_le; auto ] ];
auto with real.
apply Rplus_le_reg_l with (r := (- q)%R).
replace (- q + 0)%R with (- q)%R; [ idtac | ring ].
replace (- q + (p + q))%R with (FtoRradix p); [ idtac | ring ].
rewrite <- (Rabs_right (FtoRradix p)); auto with real.
rewrite <- (Rabs_left (FtoRradix q)); auto with real.
replace 0%R with (0 + 0)%R; auto with real.
Qed.

(* Specifications: *)
Theorem plusClosestLowerBound :
forall p q pq : float,
Closest b radix (p + q) pq ->
Fbounded b p ->
Fbounded b q ->
pq <> (p + q)%R :>R -> (/ radix * Rmax (Rabs p) (Rabs q) <= Rabs pq)%R.