Instance Z_Serializer : Serializer Z :=
  {| serialize := Z_serialize;
     deserialize := Z_deserialize;
     serialize_deserialize_id := Z_serialize_deserialize_id
  |}.Definition N_serialize n :=
  match n with
  | N0 => serialize false
  | Npos p => IOStreamWriter.append (fun _ => serialize true)
                                    (fun _ => serialize p)
  end.

Lemma N_serialize_deserialize_id : serialize_deserialize_id_spec N_serialize N_deserialize.