intros x y H' H'0.
case (Zle_or_lt (Fexp x) (Fexp y)); intros Zl1.
exists (Fnum y * Zpower_nat radix (Zabs_nat (Fexp y - Fexp x)))%Z.
pattern (Fexp x) at 2 in |- *;
replace (Fexp x) with (Fexp y - Zabs_nat (Fexp y - Fexp x))%Z.
unfold FtoRradix in |- *;
rewrite <-
(FshiftCorrect radix) with (n := Zabs_nat (Fexp y - Fexp x)) (x := y);
auto.
rewrite inj_abs; try ring; auto with zarith.
exists (Zquotient (Fnum y) (Zpower_nat radix (Zabs_nat (Fexp x - Fexp y)))).
unfold FtoRradix in |- *;
rewrite <-
(FshiftCorrect radix)
with
(n := Zabs_nat (Fexp x - Fexp y))
(x :=
Float
(Zquotient (Fnum y)
(Zpower_nat radix (Zabs_nat (Fexp x - Fexp y))))
(Fexp x)); auto.
unfold Fshift in |- *; simpl in |- *.
cut (0 <= Fexp x - Fexp y)%Z;
[ intros Le1; repeat rewrite inj_abs | auto with zarith ];
auto.
unfold FtoR in |- *; simpl in |- *; auto.
replace (Fexp x - (Fexp x - Fexp y))%Z with (Fexp y); [ idtac | ring ].
replace
(Zquotient (Fnum y) (Zpower_nat radix (Zabs_nat (Fexp x - Fexp y))) *
Zpower_nat radix (Zabs_nat (Fexp x - Fexp y)))%Z with (
Fnum y); auto.
apply ZdividesZquotient; auto with zarith.
apply
ZdividesTrans
with (m := Zpower_nat radix (maxDiv (Fnum y) (Fdigit radix y))).
apply maxDivCorrect.
apply ZdividesLessPow; auto.
apply ZleLe.
rewrite inj_abs; auto with zarith.
apply Zplus_le_reg_l with (p := Fexp y).
apply Zle_trans with (LSB x).
replace (Fexp y + (Fexp x - Fexp y))%Z with (Fexp x); [ idtac | ring ].
apply Fexp_le_LSB.
rewrite Zplus_comm; auto.
Qed.

Theorem LSB_rep_min :
forall p : float, exists z : Z, p = Float z (LSB p) :>R.