Proof using.
induction j using json.json_rect with
(P_list := fun l => untreeify_list (List.map json_treeify l) = Some l)
(P_list' := fun l => untreeify_obj_list (obj_list_to_tree_list l) = Some l);
unfold treeify_untreeify_aux;
auto;
simpl;
try (fold untreeify_list);
try (fold untreeify_obj_list);
try (fold obj_list_to_tree_list);
try (rewrite IHj);
try (rewrite IHj0);
auto.
Qed.
Definition json_serialize (j : json.t) : IOStreamWriter.t :=
serialize (json_treeify j).
Definition json_deserialize : ByteListReader.t json.t :=
j <- deserialize;;
match json_untreeify j with
| Some j => ByteListReader.ret j
| None => ByteListReader.error
end.

Lemma json_serialize_deserialize_id :
serialize_deserialize_id_spec json_serialize json_deserialize.