(* Copied from RamifyCoq project *)
Require Export Coq.Relations.Relation_Definitions.
Require Export Coq.Lists.List.
Local Open Scope equiv_scope.
Section ListFun2.
Context {A B: Type}.
Context {RA: relation A}.
Context {RB: relation B}.
Context {EqRA: Equivalence RA}.
Context {EqRB: Equivalence RB}.
Instance proper_fold_left: forall (f: A -> B -> A) {Proper_f: Proper (equiv ==> equiv ==> equiv) f}, Proper (Forall2 equiv ==> equiv ==> equiv) (fold_left f).

Lemma monoid_fold_left_tail: forall {f: A -> B -> A} {Proper_f: Proper (equiv ==> equiv ==> equiv) f} (e: A) a l,
fold_left f (l ++ a :: nil) e === f (fold_left f l e) a.