End ListFun1.
(* Above is copied from RamifyCoq project *)
Section ListFun2'.
Context {A B: Type}.
Context {RA: relation A}.
Context {RB: relation B}.
Instance proper_fold_left': forall (f: A -> B -> A) {Proper_f: Proper (RA ==> RB ==> RA) f}, Proper (Forall2 RB ==> RA ==> RA) (fold_left f).
Context {EqRA: Equivalence RA}.

(* Specifications: *)
Lemma proper_permutation_fold_left: forall (f: A -> B -> A) {Proper_f: Proper (RA ==> eq ==> RA) f},
(forall x1 x2 y z, x1 === x2 -> f (f x1 y) z === f (f x2 z) y) ->
Proper (@Permutation _ ==> RA ==> RA) (fold_left f).