(* Permutation is decidable *) 
Definition permutation_dec :
  (forall a b : A, {a = b} + {a <> b}) ->
  forall l1 l2 : list A, {permutation l1 l2} + {~ permutation l1 l2}.

Theorem fold_left_permutation : forall (A B : Type) (f : A -> B -> A), (forall (a : A) (b1 b2 : B), f (f a b1) b2 = f (f a b2) b1) -> forall (a : A) (l1 l2 : list B), permutation l1 l2 -> fold_left f l1 a = fold_left f l2 a.