Proof using.
move => net net' failed failed' out H_step.
apply step_failure_tot_mapped_simulation_1 in H_step.
rewrite /tot_map_name /tot_map_net /= 2!map_id /id /= in H_step.
rewrite /tot_map_trace_occ /= /id /= in H_step.
rewrite /tot_map_packet /= /id /= in H_step.
rewrite /mgv_deghost /=.
rewrite -/id mgv_map_id_tr in H_step.
move: H_step.
set fp := fun p : packet => _.
set fp' := fun p : packet => _.
have H_eq: fp = fp' by rewrite /fp /fp'; apply functional_extensionality; case => /= src dst m.
rewrite H_eq {H_eq fp}.
set fs1 := fun n => _.
set fs2 := fun n => _.
set fs1' := fun n => _.
set fs2' := fun n => _.
have H_eq: fs1 = fs1' by rewrite /fs1 /fs1' {fs1 fs1'}; apply functional_extensionality => n; case: net.
rewrite H_eq {H_eq fs1}.
have H_eq: fs2 = fs2' by rewrite /fs2 /fs2' {fs2 fs2'}; apply functional_extensionality => n; case: net'.
by rewrite H_eq.
Qed.
Definition mgv_ghost_packet p :=
@mkPacket _ mgv_refined_multi_params
(@pSrc _ multi_params p)
(pDst p)
(ghost_msg_default, pBody p).
Definition mgv_reghost (net : @network _ multi_params) : @network _ mgv_refined_multi_params.
refine (@mkNetwork _ mgv_refined_multi_params
(map mgv_ghost_packet
(nwPackets net))
_
).
intros.
destruct net.
concludes.
auto.
Defined.
Arguments mgv_ghost_packet /_.

(* Specifications: *)
Lemma mgv_reghost_deghost_partial_inverses :
forall net,
mgv_deghost (mgv_reghost net) = net.