(* Compute all the leaves *)
Fixpoint all_pbleaves (t : pbtree) : list A :=
  match t with
  | pbleaf a => a :: nil
  | pbleft t1 => all_pbleaves t1
  | pbright t1 => all_pbleaves t1
  | pbnode t1 t2 => all_pbleaves t1 ++ all_pbleaves t2
  end.

Theorem fold_pbadd_prop_right : forall l a, l <> nil -> fold_right (fun a (c : pbtree) => pbadd (fst a) c (snd a)) (pbleaf a) (map (fun v => match v with | (a1, b1) => (a1, true :: b1) end) l) = pbright (fold_right (fun a (c : pbtree) => pbadd (fst a) c (snd a)) (pbleaf a) l).