(** ** TM to SR with finite types *)
(* ** More preliminary lemmas *)

(* Specifications: *)
Lemma inductive_count (S:eqType) (Y:eqType) A (s:S) n (f: S -> Y):
Injective f -> count A s = n -> count (map (fun a:S => f a) A) (f s) = n.
Lemma diff_constructors_count_zero (F X Y:eqType) (A: list F) (f: F -> X) (g: Y -> X) x:
(forall a b, f a <> g b) -> count (map (fun (a:F) => f a) A) (g x) = 0.
Lemma notInZero (X: eqType) (x: X) A :
not (x el A) <-> count A x = 0.
Lemma in_sing {X} (x y:X) :
x el [y] -> x = y.
Lemma in_concat_iff A l (a:A) : a el concat l <-> exists l', a el l' /\ l' el l.
Section string_rewriting.