Local Set Implicit Arguments.
Local Unset Strict Implicit.
(* *Some basic things concerning lists *)
(* * Definitions *)
Local Definition symbol := nat.
Local Definition string := (string nat).
Local Definition card : Type := (string * string).
Local Definition stack := list card.
Local Definition SRS := SRS nat.
Implicit Types a b : symbol.
Implicit Types x y z : string.
Implicit Types d e : card.
Implicit Types A R P : stack.
Coercion sing (n : nat) := [n].
(* ** String Rewriting *)
Scheme rewt_ind' := Induction for rewt Sort Prop.
Instance PreOrder_rewt R : PreOrder (rewt R).
Instance Proper_rewt R : Proper (rewt R ==> rewt R ==> rewt R) (@app symbol).
(* ** Post Grammars *)
Fixpoint sigma (a : symbol) A :=
match A with
nil => [a]
| x/y :: A => x ++ (sigma a A) ++ y
end.
(* ** Alphabets *)
Fixpoint sym (R : list card) :=
match R with
[] => []
| x / y :: R => x ++ y ++ sym R
end.
Hint Resolve sym_word_l sym_word_R : core.

Lemma rewt_sym R x y Sigma:
sym R <<= Sigma -> x <<= Sigma -> rewt R x y -> y <<= Sigma.