(*****************************************************************************)
(*                                                                           *)
(*                     Translation respects PPO                              *)
(*                                                                           *)
(*****************************************************************************)
Ltac ppo := Ordering.ppo Nat.eq_dec Nat.eq_dec constructor_eq_dec.

(* from ordering of elements to ordering of the list *)
Lemma map_BC_to_TRS_ppo_rule bcl st: (* maybe also prove the other direction and make a _iff maybe not needed. *)
let rk := λ f : nat, rank (get_info_l (snd (lm_to_ml (map BC_to_TRS bcl) st)) f) in
(∀ (bc : BC) (st0 : state), bc ∈ bcl →
Forall (PPO_rule (get_rank (snd (BC_to_TRS bc st0)))) (rules (snd (BC_to_TRS bc st0)))) →
Forall (PPO_rule rk) (get_rules (snd (lm_to_ml (map BC_to_TRS bcl) st))).