Definition proj_left_max_size (proof_tree : cbv) : cbv :=
proj_left_max_size_list (proof_tree) (sub_trees proof_tree).

Lemma InCBV_proj_left_max_size p : InCBV (proj_left_max_size p) p.
Fixpoint max_proj_right_size (proof_tree : cbv) : nat :=
match proof_tree with
| cbv_constr lp _ t _ v => max (value_size v) (maxl (map max_proj_right_size lp))
| cbv_split lp p _ t _ v => max (value_size v) (max (max_proj_right_size p) (maxl (map max_proj_right_size lp)))
| cbv_update _ _ p _ t _ v => max (value_size v) (max_proj_right_size p)
| cbv_read _ t v => value_size v
end.