(* 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_node : forall l a, l <> nil -> fold_right (fun a (c : pbtree) => pbadd (fst a) c (snd a)) (pbright a) (map (fun v => match v with | (a1, b1) => (a1, false :: b1) end) l) = pbnode (fold_right (fun a (c : pbtree) => pbadd (fst a) c (snd a)) (pbleaf empty) l) a.