Corollary step_failure_tot_mapped_simulation_star_1 :
  forall net failed tr,
    @step_failure_star _ _ fail_fst step_failure_init (failed, net) tr ->
    @step_failure_star _ _ fail_snd step_failure_init (map tot_map_name failed, tot_map_net net) (map tot_map_trace_occ tr).

(* Specifications: *)
Lemma map_eq_name_eq_eq : forall l l', map tot_map_name l = map tot_map_name l' -> l = l'.
Theorem step_failure_tot_mapped_simulation_2 : forall net net' failed failed' out mnet mfailed mfailed' mout, @step_failure _ _ fail_snd (failed, net) (failed', net') out -> tot_map_net mnet = net -> map tot_map_name mfailed = failed -> map tot_map_name mfailed' = failed' -> map tot_map_trace_occ mout = out -> exists mnet', @step_failure _ _ fail_fst (mfailed, mnet) (mfailed', mnet') mout /\ tot_map_net mnet' = net'.
Lemma nodup_to_map_name : forall ns, NoDup ns -> NoDup (map tot_map_name ns).
Lemma permutation_nodes : Permutation nodes (map tot_map_name nodes).
Lemma tot_map_in_snd : forall h m ns nm, In nm (map (fun nm0 : name * msg => (tot_map_name (fst nm0), tot_map_msg (snd nm0))) (map2snd m (filter_rel adjacent_to_dec h ns))) -> snd nm = tot_map_msg m.
Lemma tot_map_in_in : forall n m l, (forall nm, In nm l -> snd nm = m) -> ~ In (n, m) l -> ~ In (tot_map_name n, tot_map_msg m) (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) l).
Lemma msg_in_map : forall m l n m', (forall nm, In nm l -> snd nm = m) -> In (tot_map_name n, tot_map_msg m') (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) l) -> tot_map_msg m' = tot_map_msg m.
Lemma nodup_tot_map : forall m nms, (forall nm, In nm nms -> snd nm = m) -> NoDup nms -> NoDup (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) nms).
Lemma in_tot_map_name : forall m l n, (forall nm, In nm l -> snd nm = m) -> In (n, tot_map_msg m) (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) l) -> In (tot_map_name_inv n, m) l.
Lemma in_map_pair_adjacent_to : forall (m : @msg _ multi_fst) ns failed h n, In (tot_map_name_inv n, m) (map2snd m (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed ns))) -> In (tot_map_name_inv n) (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed ns)).
Lemma in_adjacent_exclude_in_exlude : forall ns failed n h, In (tot_map_name_inv n) (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed ns)) -> In (tot_map_name_inv n) (remove_all name_eq_dec failed ns) /\ adjacent_to h (tot_map_name_inv n).
Lemma in_failed_exclude : forall ns failed n, In (tot_map_name_inv n) (remove_all name_eq_dec failed ns) -> ~ In (tot_map_name_inv n) failed /\ In (tot_map_name_inv n) ns.
Lemma in_in_adj_map_pair : forall (m : msg) ns failed n h, In n ns -> ~ In n (map tot_map_name failed) -> adjacent_to h n -> In (n, m) (map2snd m (filter_rel adjacent_to_dec h (remove_all name_eq_dec (map tot_map_name failed) ns))).
Lemma in_exclude_not_in_failed_map : forall ns n failed, In n (remove_all name_eq_dec (map tot_map_name failed) ns) -> ~ In n (map tot_map_name failed) /\ In n ns.
Lemma not_in_map_not_in_failed : forall failed n, ~ In n (map tot_map_name failed) -> ~ In (tot_map_name_inv n) failed.
Lemma in_tot_map_msg : forall m l n, (forall nm, In nm l -> snd nm = m) -> In (tot_map_name_inv n, m) l -> In (n, tot_map_msg m) (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) l).
Lemma adjacent_in_in_msg : forall (m : @msg base_fst multi_fst) ns n h, adjacent_to h (tot_map_name_inv n) -> In (tot_map_name_inv n) ns -> In (tot_map_name_inv n, m) (map2snd m (filter_rel adjacent_to_dec h ns)).
Lemma not_in_failed_in_exclude : forall ns n failed, ~ In (tot_map_name_inv n) failed -> In (tot_map_name_inv n) ns -> In (tot_map_name_inv n) (remove_all name_eq_dec failed ns).
Lemma tot_map_name_in : forall ns n, In (tot_map_name n) (map tot_map_name ns) -> In n ns.
Lemma nodup_perm_map_map_pair_perm : forall h m failed ns ns', NoDup ns -> Permutation (map tot_map_name ns) ns' -> Permutation (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) (map2snd m (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed ns)))) (map2snd (tot_map_msg m) (filter_rel adjacent_to_dec (tot_map_name h) (remove_all name_eq_dec (map tot_map_name failed) ns'))).
Lemma map_map_pair_eq : forall h m failed, Permutation (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) (map2snd m (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed nodes)))) (map2snd (tot_map_msg m) (filter_rel adjacent_to_dec (tot_map_name h) (remove_all name_eq_dec (map tot_map_name failed) nodes))).
Lemma map_msg_fail_eq_nodup : forall h failed ns ns', NoDup ns -> Permutation (map tot_map_name ns) ns' -> Permutation (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) (map2snd msg_fail (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed ns)))) (map2snd msg_fail (filter_rel adjacent_to_dec (tot_map_name h) (remove_all name_eq_dec (map tot_map_name failed) ns'))).
Lemma map_msg_fail_eq : forall h failed, Permutation (map (fun nm : name * msg => (tot_map_name (fst nm), tot_map_msg (snd nm))) (map2snd msg_fail (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed nodes)))) (map2snd msg_fail (filter_rel adjacent_to_dec (tot_map_name h) (remove_all name_eq_dec (map tot_map_name failed) nodes))).