#[global]
Instance CPermutation_Equivalence A : Equivalence (@CPermutation A) | 10 := {
  Equivalence_Reflexive := @CPermutation_refl A ;
  Equivalence_Symmetric := @CPermutation_sym A ;
  Equivalence_Transitive := @CPermutation_trans A }.Implicit Types a b : A.Implicit Types l : list A.

(* Specifications: *)
Lemma CPermutation_app : forall l1 l2 l3, CPermutation (l1 ++ l2) l3 -> CPermutation (l2 ++ l1) l3.
Theorem CPermutation_app_comm : forall l1 l2, CPermutation (l1 ++ l2) (l2 ++ l1).
Lemma CPermutation_app_rot : forall l1 l2 l3, CPermutation (l1 ++ l2 ++ l3) (l2 ++ l3 ++ l1).
Lemma CPermutation_cons_append : forall l a, CPermutation (a :: l) (l ++ [a]).
Lemma CPermutation_morph_cons : forall P : list A -> Prop, (forall a l, P (l ++ [a]) -> P (a :: l)) -> Proper (@CPermutation A ==> iff) P.
Lemma CPermutation_length_1 : forall a b, CPermutation [a] [b] -> a = b.
Lemma CPermutation_length_1_inv : forall a l, CPermutation [a] l -> l = [a].
Lemma CPermutation_swap : forall a b, CPermutation [a; b] [b; a].
Lemma CPermutation_length_2 : forall a1 a2 b1 b2, CPermutation [a1; a2] [b1; b2] -> a1 = b1 /\ a2 = b2 \/ a1 = b2 /\ a2 = b1.
Lemma CPermutation_length_2_inv : forall a b l, CPermutation [a; b] l -> l = [a; b] \/ l = [b; a].
Lemma CPermutation_vs_elt_inv : forall l l1 l2 a, CPermutation l (l1 ++ a :: l2) -> exists l' l'', l2 ++ l1 = l'' ++ l' /\ l = l' ++ a :: l''.
Lemma CPermutation_vs_cons_inv : forall l l0 a, CPermutation l (a :: l0) -> exists l' l'', l0 = l'' ++ l' /\ l = l' ++ a :: l''.