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

Lemma subfapplies_activation_le_rank i s p c1 f lt c2 v f' lt' : let proof_tree := cbv_update i s p c1 (fapply f lt) c2 v in PPO_prog -> wf proof_tree -> In (fapply f' lt') (fapplies_in_term (proj_left p)) -> rank f' <= rank f.