Definition up (G : cfg Gamma') : cfg Gamma :=
    (f (startsym G), map (fun '(x,A) => (f x, map f A) ) (rules G)).

(* Specifications: *)
Lemma mapo_map x : mapo g (map f x) = x.
Lemma up_rew1 G x y : rew_cfg G x y -> rew_cfg (up G) (map f x) (map f y).
Lemma up_rew2 G x y : rew_cfg (up G) x y -> rew_cfg G (mapo g x) (mapo g y).
Lemma up_char1 G x y : rewt G x y -> rewt (up G) (map f x) (map f y).
Lemma up_char2 G x y : rewt (up G) x y -> rewt G (mapo g x) (mapo g y).
Lemma up_ter1 G x : terminal G x -> terminal (up G) (map f x).
Lemma up_ter2 G y : terminal (up G) y -> terminal G (mapo g y).