Fixpoint first_activations_rec (proof_tree : cbv) : list cbv :=
match proof_tree with
| cbv_constr lp _ _ _ _ => flat_map first_activations_rec lp
| cbv_split lp p _ _ _ _ => first_activations_rec p ++ flat_map first_activations_rec lp
| cbv_update _ _ _ _ _ _ _ as p' => [p']
| cbv_read _ _ _ => []
end.
Definition first_activations (proof_tree : cbv) : list cbv :=
match proof_tree with
| cbv_constr lp _ _ _ _ => []
| cbv_split lp p _ _ _ _ => []
| cbv_update _ _ p _ _ _ _ => first_activations_rec p
| cbv_read _ _ _ => []
end.
Definition strict_activations (proof_tree: cbv) :=
flat_map activations (first_activations proof_tree).

(* Specifications: *)
Lemma first_activation_rec_is_update proof_tree p :
In p (first_activations_rec proof_tree) -> exists i s p' c1 t c2 v, p = cbv_update i s p' c1 t c2 v.
Lemma first_activation_is_update proof_tree p :
In p (first_activations proof_tree) -> exists i s p' c1 t c2 v, p = cbv_update i s p' c1 t c2 v.
Lemma in_first_activations_rec_nb_judgements_le p proof_tree :
In p (first_activations_rec proof_tree) -> nb_judgements p <= nb_judgements proof_tree.
Lemma in_first_activations_nb_judgements_lt p proof_tree :
In p (first_activations proof_tree) -> nb_judgements p < nb_judgements proof_tree.
Lemma first_activations_rec_incl_activations (p: cbv) :
incl (first_activations_rec p) (activations p).
Lemma first_activations_incl_activations (p: cbv) :
incl (first_activations p) (activations p).