Open Scope Z.
(************************************************  Definition, lemmas and useful samples of nested_pred  nested_pred only ensure the specific property to be true on nested types with memory assigned, i.e. inside structure of pointer, function, empty array are not included.  ************************************************)

Lemma fold_right_map: forall {A B C} (f: B -> A -> A) (g: C -> B) (e: A) (l: list C),
fold_right f e (map g l) = fold_right (fun c a => f (g c) a) e l.