Proof using.
intros a H.
apply all_pbleaves_unique.
rewrite <- to_btree_all_leaves.
apply all_leaves_ulist; auto.
Qed.

(* For each key, the resulting code of the computed tree is always smaller *)
Theorem to_btree_smaller :
forall t a,
length (find_code eqA_dec a (compute_code (to_btree t))) <=
length (find_code eqA_dec a (compute_pbcode t)).