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

Lemma same_rank_same_prod vv ff cc lt ls rk rk': (forall t s, In t lt -> In s ls -> (forall f, In f (functions_of_term t) -> rk f = rk' f) -> (forall f, In f (functions_of_term s) -> rk f = rk' f) -> PPO rk t s -> PPO rk' t s) -> (forall f, In f (flat_map (@functions_of_term vv ff cc) lt) -> rk f = rk' f) -> (forall f, In f (flat_map (@functions_of_term _ _ _) ls) -> rk f = rk' f) -> product (PPO rk) lt ls -> product (PPO rk') lt ls.