Definition activation_rank (p : cbv) : nat :=
  match p with
  | cbv_update _ _ _ _ (fapply f _) _ _ => rank f
  | _                                   => 0
  end.

Lemma same_rank_same_ppo_rule vv ff cc f lp (t : term vv ff cc) rk rk': rk f = rk' f -> (forall g, g ∈ (functions_of_term t) -> rk g = rk' g) -> PPO rk t (fapply f (map (@term_from_pattern _ _ _) lp)) -> PPO rk' t (fapply f (map (@term_from_pattern _ _ _) lp)).