Notation bpow e := (bpow beta e).Notation format := (generic_format beta fexp).Notation canonic := (canonic beta fexp).Notation cexp := (canonic_exp beta fexp).Definition Rnd_odd_pt (x f : R) :=
  format f /\ ((f = x)%R \/
    ((Rnd_DN_pt format x f \/ Rnd_UP_pt format x f) /\
    exists g : float beta, f = F2R g /\ canonic g /\ Zeven (Fnum g) = false)).Definition Rnd_odd (rnd : R -> R) :=
  forall x : R, Rnd_odd_pt x (rnd x).

(* Specifications: *)
Theorem Rnd_odd_pt_sym : forall x f : R, Rnd_odd_pt (-x) (-f) -> Rnd_odd_pt x f.
Theorem round_odd_opp : forall x, (round beta fexp Zrnd_odd (-x) = (- round beta fexp Zrnd_odd x))%R.
Theorem round_odd_pt : forall x, Rnd_odd_pt x (round beta fexp Zrnd_odd x).
Theorem Rnd_odd_pt_unicity : forall x f1 f2 : R, Rnd_odd_pt x f1 -> Rnd_odd_pt x f2 -> f1 = f2.
Theorem Rnd_odd_pt_monotone : round_pred_monotone (Rnd_odd_pt).
Lemma generic_format_fexpe_fexp: forall x, generic_format beta fexp x -> generic_format beta fexpe x.
Lemma exists_even_fexp_lt: forall (c:Z->Z), forall (x:R), (exists f:float beta, F2R f = x /\ (c (ln_beta beta x) < Fexp f)%Z) -> exists f:float beta, F2R f =x /\ canonic beta c f /\ Zeven (Fnum f) = true.
Lemma d_eq: F2R d= round beta fexp Zfloor x.
Lemma u_eq: F2R u= round beta fexp Zceil x.
Lemma d_ge_0: (0 <= F2R d)%R.
Lemma ln_beta_d: (0< F2R d)%R -> (ln_beta beta (F2R d) = ln_beta beta x :>Z).
Lemma Fexp_d: (0 < F2R d)%R -> Fexp d =fexp (ln_beta beta x).
Lemma format_bpow_x: (0 < F2R d)%R -> generic_format beta fexp (bpow (ln_beta beta x)).
Lemma format_bpow_d: (0 < F2R d)%R -> generic_format beta fexp (bpow (ln_beta beta (F2R d))).
Lemma d_le_m: (F2R d <= m)%R.
Lemma m_le_u: (m <= F2R u)%R.
Lemma ln_beta_m: (0 < F2R d)%R -> (ln_beta beta m =ln_beta beta (F2R d) :>Z).
Lemma ln_beta_m_0: (0 = F2R d)%R -> (ln_beta beta m =ln_beta beta (F2R u)-1:>Z)%Z.
Lemma u'_eq: (0 < F2R d)%R -> exists f:float beta, F2R f = F2R u /\ (Fexp f = Fexp d)%Z.
Lemma m_eq: (0 < F2R d)%R -> exists f:float beta, F2R f = m /\ (Fexp f = fexp (ln_beta beta x) -1)%Z.
Lemma m_eq_0: (0 = F2R d)%R -> exists f:float beta, F2R f = m /\ (Fexp f = fexp (ln_beta beta (F2R u)) -1)%Z.
Lemma fexp_m_eq_0: (0 = F2R d)%R -> (fexp (ln_beta beta (F2R u)-1) < fexp (ln_beta beta (F2R u))+1)%Z.
Lemma Fm: generic_format beta fexpe m.
Lemma Zm: exists g : float beta, F2R g = m /\ canonic beta fexpe g /\ Zeven (Fnum g) = true.
Lemma DN_odd_d_aux: forall z, (F2R d<= z< F2R u)%R -> Rnd_DN_pt (generic_format beta fexp) z (F2R d).
Lemma UP_odd_d_aux: forall z, (F2R d< z <= F2R u)%R -> Rnd_UP_pt (generic_format beta fexp) z (F2R u).
Theorem round_odd_prop_pos: round beta fexp (Znearest choice) (round beta fexpe Zrnd_odd x) = round beta fexp (Znearest choice) x.
Theorem canonizer: forall f, generic_format beta fexp f -> exists g : float beta, f = F2R g /\ canonic beta fexp g.
Theorem round_odd_prop: forall x, round beta fexp (Znearest choice) (round beta fexpe Zrnd_odd x) = round beta fexp (Znearest choice) x.
Theorem Rnd_odd_pt_sym : forall x f : R, Rnd_odd_pt (-x) (-f) -> Rnd_odd_pt x f.
Theorem round_odd_opp : forall x, (round beta fexp Zrnd_odd (-x) = (- round beta fexp Zrnd_odd x))%R.
Theorem round_odd_pt : forall x, Rnd_odd_pt x (round beta fexp Zrnd_odd x).
Theorem Rnd_odd_pt_unicity : forall x f1 f2 : R, Rnd_odd_pt x f1 -> Rnd_odd_pt x f2 -> f1 = f2.
Theorem Rnd_odd_pt_monotone : round_pred_monotone (Rnd_odd_pt).
Lemma generic_format_fexpe_fexp: forall x, generic_format beta fexp x -> generic_format beta fexpe x.
Lemma exists_even_fexp_lt: forall (c:Z->Z), forall (x:R), (exists f:float beta, F2R f = x /\ (c (ln_beta beta x) < Fexp f)%Z) -> exists f:float beta, F2R f =x /\ canonic beta c f /\ Zeven (Fnum f) = true.
Lemma d_eq: F2R d= round beta fexp Zfloor x.
Lemma u_eq: F2R u= round beta fexp Zceil x.
Lemma d_ge_0: (0 <= F2R d)%R.
Lemma ln_beta_d: (0< F2R d)%R -> (ln_beta beta (F2R d) = ln_beta beta x :>Z).
Lemma Fexp_d: (0 < F2R d)%R -> Fexp d =fexp (ln_beta beta x).
Lemma format_bpow_x: (0 < F2R d)%R -> generic_format beta fexp (bpow (ln_beta beta x)).
Lemma format_bpow_d: (0 < F2R d)%R -> generic_format beta fexp (bpow (ln_beta beta (F2R d))).
Lemma d_le_m: (F2R d <= m)%R.
Lemma m_le_u: (m <= F2R u)%R.
Lemma ln_beta_m: (0 < F2R d)%R -> (ln_beta beta m =ln_beta beta (F2R d) :>Z).
Lemma ln_beta_m_0: (0 = F2R d)%R -> (ln_beta beta m =ln_beta beta (F2R u)-1:>Z)%Z.
Lemma u'_eq: (0 < F2R d)%R -> exists f:float beta, F2R f = F2R u /\ (Fexp f = Fexp d)%Z.
Lemma m_eq: (0 < F2R d)%R -> exists f:float beta, F2R f = m /\ (Fexp f = fexp (ln_beta beta x) -1)%Z.
Lemma m_eq_0: (0 = F2R d)%R -> exists f:float beta, F2R f = m /\ (Fexp f = fexp (ln_beta beta (F2R u)) -1)%Z.
Lemma fexp_m_eq_0: (0 = F2R d)%R -> (fexp (ln_beta beta (F2R u)-1) < fexp (ln_beta beta (F2R u))+1)%Z.
Lemma Fm: generic_format beta fexpe m.
Lemma Zm: exists g : float beta, F2R g = m /\ canonic beta fexpe g /\ Zeven (Fnum g) = true.
Lemma DN_odd_d_aux: forall z, (F2R d<= z< F2R u)%R -> Rnd_DN_pt (generic_format beta fexp) z (F2R d).
Lemma UP_odd_d_aux: forall z, (F2R d< z <= F2R u)%R -> Rnd_UP_pt (generic_format beta fexp) z (F2R u).
Theorem round_odd_prop_pos: round beta fexp (Znearest choice) (round beta fexpe Zrnd_odd x) = round beta fexp (Znearest choice) x.
Theorem canonizer: forall f, generic_format beta fexp f -> exists g : float beta, f = F2R g /\ canonic beta fexp g.
Theorem round_odd_prop: forall x, round beta fexp (Znearest choice) (round beta fexpe Zrnd_odd x) = round beta fexp (Znearest choice) x.