Proof with auto with typeclass_instances.
intros x Zr.
unfold canonic_exp.
apply monotone_exp.
now apply ln_beta_round_ge.
Qed.
End monotone_exp.
Section Znearest.
(** Roundings to nearest: when in the middle, use the choice function *)
Variable choice : Z -> bool.
Definition Znearest x :=
match Rcompare (x - Z2R (Zfloor x)) (/2) with
| Lt => Zfloor x
| Eq => if choice (Zfloor x) then Zceil x else Zfloor x
| Gt => Zceil x
end.

(* Specifications: *)
Theorem Znearest_DN_or_UP :
forall x,
Znearest x = Zfloor x \/ Znearest x = Zceil x.
Theorem Znearest_ge_floor :
forall x,
(Zfloor x <= Znearest x)%Z.
Theorem Znearest_le_ceil :
forall x,
(Znearest x <= Zceil x)%Z.
Theorem Znearest_DN_or_UP :
forall x,
Znearest x = Zfloor x \/ Znearest x = Zceil x.
Theorem Znearest_ge_floor :
forall x,
(Zfloor x <= Znearest x)%Z.
Theorem Znearest_le_ceil :
forall x,
(Znearest x <= Zceil x)%Z.