(* Sizes *)

Fixpoint value_size (v : value) : nat :=
  match v with
  | c_capply _ lv => 1 + suml (map value_size lv)
  end.Fixpoint term_size (t : term) :=
  match t with
  | var _ => 1
  | capply _ lt => 1 + suml (map term_size lt)
  | fapply _ lt => 1 + suml (map term_size lt)
  end.

(* Specifications: *)
Lemma gt_term_size_O t : term_size t > 0.
Lemma in_capply_term_size_lt c (t : term) lt : In t lt -> term_size t < term_size (capply c lt).
Lemma in_fapply_term_size_lt f (t : term) lt : In t lt -> term_size t < term_size (fapply f lt).