Instance Proper_perm_not_nil {A: Type}: Proper (@Permutation A ==> iff) (@not_nil A).Definition semi_group_fold {A: Type} (default: A) (f: A -> A -> A) (l: list A): A :=
  match l with
  | nil => default
  | a :: l0 => fold_left f l0 a
  end.Instance proper_semi_group_fold: forall (f: A -> A -> A) (default: A) {Proper_f: Proper (equiv ==> equiv ==> equiv) f}, Proper (Forall2 equiv ==> equiv) (semi_group_fold default f).

(* Specifications: *)
Lemma Forall2_impl: forall {A B: Type} (P Q: A -> B -> Prop), (forall a b, P a b -> Q a b) -> (forall (lA: list A) (lB: list B), Forall2 P lA lB -> Forall2 Q lA lB).
Lemma Forall2_rev: forall {A B: Type} (P: A -> B -> Prop), forall (lA: list A) (lB: list B), Forall2 (fun b a => P a b) lB lA -> Forall2 P lA lB.