Hypothesis (Hnb_steps : (1 < nb_steps)%Z).

(* Specifications: *)
Lemma inbetween_step_not_Eq :
forall x k l l',
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
(0 < k < nb_steps)%Z ->
Rcompare x (start + (Z2R nb_steps / 2 * step))%R = l' ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact l').
Theorem inbetween_step_Lo :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
(0 < k)%Z -> (2 * k + 1 < nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Lt).
Theorem inbetween_step_Hi :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
(nb_steps < 2 * k)%Z -> (k < nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Gt).
Theorem inbetween_step_Lo_not_Eq :
forall x l,
inbetween start (start + step) x l ->
l <> loc_Exact ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Lt).
Lemma middle_odd :
forall k,
(2 * k + 1 = nb_steps)%Z ->
(((start + Z2R k * step) + (start + Z2R (k + 1) * step))/2 = start + Z2R nb_steps /2 * step)%R.
Theorem inbetween_step_any_Mi_odd :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x (loc_Inexact l) ->
(2 * k + 1 = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact l).
Theorem inbetween_step_Lo_Mi_Eq_odd :
forall x k,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x loc_Exact ->
(2 * k + 1 = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Lt).
Theorem inbetween_step_Hi_Mi_even :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
l <> loc_Exact ->
(2 * k = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Gt).
Theorem inbetween_step_Mi_Mi_even :
forall x k,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x loc_Exact ->
(2 * k = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Eq).
Lemma inbetween_step_not_Eq :
forall x k l l',
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
(0 < k < nb_steps)%Z ->
Rcompare x (start + (Z2R nb_steps / 2 * step))%R = l' ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact l').
Theorem inbetween_step_Lo :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
(0 < k)%Z -> (2 * k + 1 < nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Lt).
Theorem inbetween_step_Hi :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
(nb_steps < 2 * k)%Z -> (k < nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Gt).
Theorem inbetween_step_Lo_not_Eq :
forall x l,
inbetween start (start + step) x l ->
l <> loc_Exact ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Lt).
Lemma middle_odd :
forall k,
(2 * k + 1 = nb_steps)%Z ->
(((start + Z2R k * step) + (start + Z2R (k + 1) * step))/2 = start + Z2R nb_steps /2 * step)%R.
Theorem inbetween_step_any_Mi_odd :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x (loc_Inexact l) ->
(2 * k + 1 = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact l).
Theorem inbetween_step_Lo_Mi_Eq_odd :
forall x k,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x loc_Exact ->
(2 * k + 1 = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Lt).
Theorem inbetween_step_Hi_Mi_even :
forall x k l,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x l ->
l <> loc_Exact ->
(2 * k = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Gt).
Theorem inbetween_step_Mi_Mi_even :
forall x k,
inbetween (start + Z2R k * step) (start + Z2R (k + 1) * step) x loc_Exact ->
(2 * k = nb_steps)%Z ->
inbetween start (start + Z2R nb_steps * step) x (loc_Inexact Eq).