(* Turn a code into a tree *) 
Definition pbbuild (l : code A) : pbtree :=
  fold_right (fun a c => pbadd (fst a) c (snd a)) (pbleaf empty) l.

Theorem all_pbleaves_compute_pb : forall t, permutation (map (fst (B:=_)) (compute_pbcode t)) (all_pbleaves t).