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

(* replacing the rank function by a locally equivalent one *)
Lemma same_rank_same_ppo_iff s t rk rk':   (* => Ordering *)
(∀ f, f ∈ functions_of_term t → rk f = rk' f) →
(∀ f, f ∈ functions_of_term s → rk f = rk' f) →
PPO rk t s ↔ PPO rk' t s.