Definition activation_function (function_default : function) (p: cbv) :=
  match p with
    | cbv_update _ _ _ _ (fapply f _) _ _ => f
    | _                                   => function_default
  end.

Lemma first_activations_at_given_rank_incl i s p c1 t c2 v r : let proof_tree := cbv_update i s p c1 t c2 v in PPO_prog -> wf proof_tree -> r < activation_rank rank proof_tree -> incl (first_activations_at_given_rank r proof_tree) (flat_map (@first_activations _ _ _) (flat_map (fun r' => activations_at_rank r' proof_tree) (seq (1 + r) (max_rank - r)))).