Proposition BC_to_TRS_rules_vars_defined bc n s st:
  let trs := snd (BC_to_TRS bc st) in
  arities bc = ok_arities n s →
  Forall rule_vars_defined trs.(rules).

(* Specifications: *)
Lemma max_arity_prog_cons (r:rule) rl: (* => Syntax.v ? *) max_arity_prog (r::rl) = max (max_arity_rule r) (max_arity_prog rl).
Lemma max_arity_prog_app (prg1 prg2: list rule): (* => Syntax.v ? *) max_arity_prog (prg1++prg2) = max (max_arity_prog prg1) (max_arity_prog prg2).
Lemma max_arity_fapply_app f (l1 l2: list term): (* => Syntax.v ? *) max_arity_term (fapply f (l1++l2)) = max (length (l1++l2)) (max (maxl (map (@max_arity_term _ _ _) l1)) (maxl (map (@max_arity_term _ _ _) l2))).
Lemma max_arity_fapply_tvl f n m: n≤m → max_arity_term (fapply f (mk_tvl n m)) = m-n.
Lemma max_arity_fapply_args f h n s: max_arity_term (fapply h (mk_args_h (S n) s (mk_call (S (n + s)) f))) = n+s+2.
Lemma max_arity_make_rec n s g h0 h1 f: max_arity_prog (rules g) ≤ maxar g → max_arity_prog (rules h0) ≤ maxar h0 → max_arity_prog (rules h1) ≤ maxar h1 → max_arity_prog (rules (make_rec (S n) s g h0 h1 f)) ≤ maxar (make_rec (S n) s g h0 h1 f).
Lemma max_arity_make_comp n s h gN gS f: max_arity_prog (rules h) ≤ maxar h → (max_arity_prog (concat (map rules gN))) ≤ maxl (map maxar gN) → (max_arity_prog (concat (map rules gS))) ≤ maxl (map maxar gS) → max_arity_prog (rules (make_comp n s h gN gS f)) ≤ maxar (make_comp n s h gN gS f).
Lemma max_arity_prog_forall l: Forall (λ prg, max_arity_prog (rules prg) ≤ maxar prg) l → (max_arity_prog (concat (map rules l))) ≤ maxl (map maxar l).