(* 
  A step is valid if the two smallest elements of the initial list
  have been merged
*)
Definition one_step (l1 l2 : list (btree A)) : Prop :=
  exists l3 : list (btree A),
    (exists t1 : btree A,
       (exists t2 : btree A,
          ordered (sum_order f) (t1 :: t2 :: l3) /\
          permutation l1 (t1 :: t2 :: l3) /\
          permutation l2 (node t1 t2 :: l3))).

Theorem one_step_same_sum_leaves : forall l1 l2 l3 : list (btree A), one_step l1 l2 -> one_step l1 l3 -> same_sum_leaves f l2 l3.