Definition compatible_rule (r:rule) : Prop :=
  match r with
    | rule_intro f _ t => forall f', In f' (functions_of_term t) -> rank f' <= rank f
  end.Definition compatible_prog : Prop :=
  forall r, In r prog -> compatible_rule r.

Lemma sub_term_strict_lt_size (t1 t2: term) : In t1 (sub_terms_strict t2) -> term_size t1 < term_size t2.