(****************************************************************************  IEEE754  :  Fround  Laurent Thery  ******************************************************************************)
Require Export Fprop.
Require Export Fodd.
Section FRound.
Variable b : Fbound.
Variable radix : Z.
Variable precision : nat.
Let FtoRradix := FtoR radix.
Local Coercion FtoRradix : float >-> R.
Hypothesis radixMoreThanOne : (1 < radix)%Z.
Hypothesis precisionGreaterThanOne : 1 < precision.
Hypothesis pGivesBound : Zpos (vNum b) = Zpower_nat radix precision.
Definition TotalP (P : R -> float -> Prop) :=
forall r : R, exists p : float, P r p.
Definition UniqueP (P : R -> float -> Prop) :=
forall (r : R) (p q : float), P r p -> P r q -> p = q :>R.
Definition CompatibleP (P : R -> float -> Prop) :=
forall (r1 r2 : R) (p q : float),
P r1 p -> r1 = r2 -> p = q :>R -> Fbounded b q -> P r2 q.
Definition MinOrMaxP (P : R -> float -> Prop) :=
forall (r : R) (p : float), P r p -> isMin b radix r p \/ isMax b radix r p.
Definition RoundedModeP (P : R -> float -> Prop) :=
TotalP P /\ CompatibleP P /\ MinOrMaxP P /\ MonotoneP radix P.

(* Specifications: *)
Theorem RoundedModeP_inv1 : forall P, RoundedModeP P -> TotalP P.
intros P H; case H; auto.