Corollary activations_inCBV: forall p pi:cbv,
   In p (activations pi) -> InCBV p pi.Definition functions_of_prog : list function :=
  map (fun x => match x with | rule_intro f _ _ => f end) prog.

(* Specifications: *)
Lemma activation_is_function : forall proof_tree p, In p (activations proof_tree) -> exists i s p' c1 t c2 v, p = cbv_update i s p' c1 t c2 v.
Lemma cbv_update_in_activations_InCBV proof_tree sub_proof_tree i s p c1 t c2 v: sub_proof_tree = cbv_update i s p c1 t c2 v -> InCBV sub_proof_tree proof_tree -> In sub_proof_tree (activations proof_tree).
Lemma activations_wf : forall proof_tree p, wf proof_tree -> In p (activations proof_tree) -> wf p.
Lemma le_max_active_size proof_tree p : In p (activations proof_tree) -> term_size (proj_left p) + value_size (proj_right p) <= max_active_size proof_tree.
Lemma activation_bound_spec ( subst_default : variable -> value) : forall proof_tree, wf proof_tree -> forall p, In p (activations proof_tree) -> let (i, s) := rule_subst_of_cbv_update subst_default p in term_size (subst s (rhs_of_rule (nth i prog rule_default))) <= activation_bound prog (term_size (proj_left p)).