Proof using multi_map_lb_congr multi_map_congr.
move => net net' failed failed' lb tr H_eq H_step.
invcs H_step => //=.
- destruct (pt_map_packet p) eqn:?.
destruct p, p0.
simpl in *.
break_match_hyp => //.
find_injection.
have H_q := @pt_net_handlers_some _ _ _ _ _ _ _ multi_map_congr pDst pSrc pBody (nwState net pDst) _ Heqo0.
rewrite /pt_mapped_net_handlers /net_handlers /= /unlabeled_net_handlers in H_q.
repeat break_let.
repeat tuple_inversion.
have H_q' := @pt_lb_net_handlers_some _ _ _ _ _ _ _ _ multi_map_lb_congr _ _ _ _ _ _ _ _ _ Heqo0 Heqp1.
break_and.
unfold tot_mapped_lb_net_handlers_label in *.
repeat break_let.
by repeat tuple_inversion.
destruct p.
simpl in *.
break_match_hyp => //.
have H_q := @pt_net_handlers_none _ _ _ _ _ _ _ multi_map_congr pDst pSrc pBody (nwState net pDst) out d l Heqo0.
rewrite /net_handlers /= /unlabeled_net_handlers in H_q.
repeat break_let.
repeat tuple_inversion.
concludes.
break_and.
have H_q' := @pt_lb_net_handlers_none _ _ _ _ _ _ _ _ multi_map_lb_congr pDst pSrc _ (nwState net pDst) Heqo0.
rewrite /tot_mapped_lb_net_handlers_label in H_q'.
repeat break_let.
repeat tuple_inversion.
rewrite /pt_map_net /=.
rewrite filterMap_app.
rewrite filterMap_pt_map_name_msg_empty_eq //=.
rewrite H3.
rewrite filterMap_app /=.
repeat break_match => //.
rewrite -filterMap_app.
set s1 := fun _ => _.
set s2 := fun _ => _.
have H_eq_s: s1 = s2.
rewrite /s1 /s2.
apply functional_extensionality => n.
rewrite /update.
by break_if; first by rewrite H e.
rewrite -H_eq_s /s1 {s1 s2 H_eq_s}.
split => //.
exact: LabeledStepFailure_stutter.
- case H_i: (pt_map_input inp) => [inp'|].
have H_q := @pt_input_handlers_some _ _ _ _ _ _ _ multi_map_congr h _ (nwState net h) _ H_i.
rewrite /pt_mapped_input_handlers /input_handlers /= /unlabeled_input_handlers in H_q.
repeat break_let.
repeat tuple_inversion.
have H_q' := @pt_lb_input_handlers_some _ _ _ _ _ _ _ _ multi_map_lb_congr _ _ _ _ _ _ _ _ H_i Heqp1.
break_and.
unfold tot_mapped_lb_input_handlers_label in *.
repeat break_let.
by tuple_inversion.
have H_q := @pt_input_handlers_none _ _ _ _ _ _ _ multi_map_congr h _ (nwState net h) out d l H_i.
rewrite /input_handlers /= /unlabeled_input_handlers in H_q.
repeat break_let.
repeat tuple_inversion.
concludes.
break_and.
have H_q' := @pt_lb_input_handlers_none _ _ _ _ _ _ _ _ multi_map_lb_congr h _ (nwState net h) H_i.
rewrite /tot_mapped_lb_input_handlers_label in H_q'.
repeat break_let.
repeat tuple_inversion.
rewrite /pt_map_net /=.
rewrite filterMap_app.
rewrite filterMap_pt_map_name_msg_empty_eq //=.
set s1 := fun _ => _.
set s2 := fun _ => _.
have H_eq_s: s1 = s2.
rewrite /s1 /s2.
apply functional_extensionality => n.
rewrite /update.
by break_if; first by rewrite H e.
rewrite -H_eq_s /s1 {s1 s2 H_eq_s}.
split; first exact: LabeledStepFailure_stutter.
by repeat find_rewrite.
- split => //; exact: LabeledStepFailure_stutter.
Qed.
(* lb_step_ordered_failure *)

Theorem lb_step_ordered_failure_pt_mapped_simulation_1_non_silent :
forall net net' failed failed' lb tr,
tot_map_label lb <> label_silent ->
@lb_step_ordered_failure _ labeled_multi_fst (failed, net) lb (failed', net') tr ->
@lb_step_ordered_failure _ labeled_multi_snd (List.map tot_map_name failed, pt_map_onet net) (tot_map_label lb) (List.map tot_map_name failed', pt_map_onet net') (filterMap pt_map_trace_ev tr).