Hint Resolve lt_0_pow.
Hint Rewrite mult_1_l.
Fixpoint first_activations_at_given_rank (rk: nat) (proof_tree : cbv) : list cbv :=
match proof_tree with
| cbv_constr lp _ _ _ _ => flat_map (first_activations_at_given_rank rk) lp
| cbv_split lp p _ _ _ _ => first_activations_at_given_rank rk p ++ flat_map (first_activations_at_given_rank rk) lp
| cbv_update _ _ p _ (fapply f _) _ _ as p' => if eq_nat_dec rk (rank f)
then [ p' ]
else first_activations_at_given_rank rk p
| _ => [] (* cbv_read and ill-formed cbv_update *)
end.
Definition activation_function (function_default : function) (p: cbv) :=
match p with
| cbv_update _ _ _ _ (fapply f _) _ _ => f
| _                                   => function_default
end.

Lemma activation_eq_dec p i s p0 c1 t c2 v:
let proof_tree := cbv_update i s p0 c1 t c2 v in
PPO_prog ->
wf proof_tree ->
In p (activations proof_tree) -> p = proof_tree \/ p <> proof_tree.