Hypothesis above_monotone:
forall x1 x2, X.eq x1 x2 \/ X.lt x1 x2 -> above_low_bound x1 = true -> above_low_bound x2 = true.
Hypothesis below_monotone:
forall x1 x2, X.eq x1 x2 \/ X.lt x2 x1 -> below_high_bound x1 = true -> below_high_bound x2 = true.
Remark In_raw_partition_between_3:
forall x m,
Raw.In x (fst (raw_partition_between m)) -> above_low_bound x = true /\ below_high_bound x = true.
Remark In_raw_partition_between_4:
forall x m,
Raw.bst m ->
Raw.In x (snd (raw_partition_between m)) -> above_low_bound x = false \/ below_high_bound x = false.
Remark In_raw_partition_between_5:
forall x m,
Raw.bst m ->
Raw.In x m -> above_low_bound x = true -> below_high_bound x = true ->
Raw.In x (fst (raw_partition_between m)).
Remark In_raw_partition_between_6:
forall x m,
Raw.bst m ->
Raw.In x m -> above_low_bound x = false \/ below_high_bound x = false ->
Raw.In x (snd (raw_partition_between m)).
Definition partition_between (s: t) : t * t :=
let p := raw_partition_between s.(MSet.this) in
(@MSet.Mkt (fst p) (proj1 (raw_partition_between_ok s.(MSet.this) s.(MSet.is_ok))),
@MSet.Mkt (snd p) (proj2 (raw_partition_between_ok s.(MSet.this) s.(MSet.is_ok)))).

(* Specifications: *)
Theorem partition_between_iff_1:
forall x s,
In x (fst (partition_between s)) <->
In x s /\ above_low_bound x = true /\ below_high_bound x = true.
Theorem partition_between_iff_2:
forall x s,
In x (snd (partition_between s)) <->
In x s /\ (above_low_bound x = false \/ below_high_bound x = false).