(* 
  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_weight_tree_list : forall l1 l2 l3 : list (btree A), one_step l1 l2 -> one_step l1 l3 -> weight_tree_list f l2 = weight_tree_list f l3.