Definition ordered_Rlist (l:list R) : Prop :=
forall i:nat, (i < pred (length l))%nat -> pos_Rl l i <= pos_Rl l (S i).
Fixpoint insert (l:list R) (x:R) : list R :=
match l with
| nil => x :: nil
| a :: l' =>
match Rle_dec a x with
| left _ => a :: (insert l' x)
| right _ => x :: l
end
end.
Fixpoint cons_ORlist (k l:list R) : list R :=
match k with
| nil => l
| a :: k' => cons_ORlist k' (insert l a)
end.
Fixpoint mid_Rlist (l:list R) (x:R) : list R :=
match l with
| nil => nil
| a :: l' => ((x + a) / 2) :: (mid_Rlist l' a)
end.
Definition Rtail (l:list R) : list R :=
match l with
| nil => nil
|  a :: l' => l'
end.
Definition FF (l:list R) (f:R -> R) : list R :=
match l with
| nil => nil
| a :: l' => map f (mid_Rlist l' a)
end.

Lemma RList_P29 :
forall (l2 l1:list R) (i:nat),
(length l1 <= i)%nat ->
(i < length (app l1 l2))%nat ->
pos_Rl (app l1 l2) i = pos_Rl l2 (i - length l1).