Proof using.
induction t using PositiveMap.tree_ind; auto.
simpl.
rewrite IHt1.
rewrite IHt2.
reflexivity.
Qed.
Definition ptree_serialize (t : PositiveMap.t A) : IOStreamWriter.t :=
serialize (tree_of_ptree t).
Definition ptree_deserialize : ByteListReader.t (PositiveMap.t A) :=
t <- deserialize;;
match ptree_of_tree t with
| Some pt => ByteListReader.ret pt
| None => ByteListReader.error
end.

Lemma ptree_serialize_deserialize_id :
serialize_deserialize_id_spec ptree_serialize ptree_deserialize.