(* What it is to be a maximum *)
 
Definition isMax (r : R) (max : float) :=
  Fbounded b max /\
  (r <= max)%R /\
  (forall f : float, Fbounded b f -> (r <= f)%R -> (max <= f)%R).

(* Specifications: *)
Theorem isMax_inv1 : forall (p : float) (r : R), isMax r p -> (r <= p)%R.
Theorem ProjectMax : ProjectorP isMax.
Theorem MonotoneMax : MonotoneP isMax.
Theorem MinEq : forall (p q : float) (r : R), isMin r p -> isMin r q -> p = q :>R.
Theorem MaxEq : forall (p q : float) (r : R), isMax r p -> isMax r q -> p = q :>R.
Theorem MinOppMax : forall (p : float) (r : R), isMin r p -> isMax (- r) (Fopp p).
Theorem MaxOppMin : forall (p : float) (r : R), isMax r p -> isMin (- r) (Fopp p).
Theorem MinMax : forall (p : float) (r : R), isMin r p -> r <> p :>R -> isMax r (FNSucc b radix precision p).
Theorem MinExList : forall (r : R) (L : list float), (forall f : float, In f L -> (r < f)%R) \/ (exists min : float, In min L /\ (min <= r)%R /\ (forall f : float, In f L -> (f <= r)%R -> (f <= min)%R)).
Theorem MinEx : forall r : R, exists min : float, isMin r min.
Theorem MaxEx : forall r : R, exists max : float, isMax r max.
Theorem MinBinade : forall (r : R) (p : float), Fbounded b p -> (p <= r)%R -> (r < FNSucc b radix precision p)%R -> isMin r p.
Theorem FminRep : forall p q : float, isMin p q -> exists m : Z, q = Float m (Fexp p) :>R.
Theorem MaxBinade : forall (r : R) (p : float), Fbounded b p -> (r <= p)%R -> (FNPred b radix precision p < r)%R -> isMax r p.
Theorem MaxMin : forall (p : float) (r : R), isMax r p -> r <> p :>R -> isMin r (FNPred b radix precision p).
Theorem FmaxRep : forall p q : float, isMax p q -> exists m : Z, q = Float m (Fexp p) :>R.