Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) (* <O___,, * (see CREDITS file for the list of authors) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************) Require Import Permutation SetoidList. (* Set Universe Polymorphism. *) Set Implicit Arguments. Unset Strict Implicit.
Permutations of list modulo a setoid equality.
Contribution by Robbert Krebbers (Nijmegen University).
Section Permutation. Context {A : Type} (eqA : relation A) (e : Equivalence eqA). Inductive PermutationA : list A -> list A -> Prop := | permA_nil: PermutationA nil nil | permA_skip x₁ x₂ l₁ l₂ : eqA x₁ x₂ -> PermutationA l₁ l₂ -> PermutationA (x₁ :: l₁) (x₂ :: l₂) | permA_swap x y l : PermutationA (y :: x :: l) (x :: y :: l) | permA_trans l₁ l₂ l₃ : PermutationA l₁ l₂ -> PermutationA l₂ l₃ -> PermutationA l₁ l₃. Local Hint Constructors PermutationA : core.A:TypeeqA:relation Ae:Equivalence eqAEquivalence PermutationAA:TypeeqA:relation Ae:Equivalence eqAEquivalence PermutationAA:TypeeqA:relation Ae:Equivalence eqAReflexive PermutationAA:TypeeqA:relation Ae:Equivalence eqASymmetric PermutationAA:TypeeqA:relation Ae:Equivalence eqATransitive PermutationAA:TypeeqA:relation Ae:Equivalence eqAReflexive PermutationAinduction l; intuition.A:TypeeqA:relation Ae:Equivalence eqAl:list APermutationA l lA:TypeeqA:relation Ae:Equivalence eqASymmetric PermutationAA:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA l₁ l₂ -> PermutationA l₂ l₁apply permA_skip; intuition.A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:PermutationA l₂ l₁PermutationA (x₂ :: l₂) (x₁ :: l₁)exact permA_trans. Qed.A:TypeeqA:relation Ae:Equivalence eqATransitive PermutationAA:TypeeqA:relation Ae:Equivalence eqAProper (eqA ==> PermutationA ==> PermutationA) consA:TypeeqA:relation Ae:Equivalence eqAProper (eqA ==> PermutationA ==> PermutationA) consnow apply permA_skip. Qed.A:TypeeqA:relation Ae:Equivalence eqAx, y:AH:eqA x yx0, y0:list AH0:PermutationA x0 y0PermutationA (x :: x0) (y :: y0)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l:list APermutationA l₁ l₂ -> PermutationA (l ++ l₁) (l ++ l₂)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l:list APermutationA l₁ l₂ -> PermutationA (l ++ l₁) (l ++ l₂)apply permA_skip; intuition. Qed.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list Aa:Al:list AIHl:PermutationA l₁ l₂ -> PermutationA (l ++ l₁) (l ++ l₂)H:PermutationA l₁ l₂PermutationA ((a :: l) ++ l₁) ((a :: l) ++ l₂)A:TypeeqA:relation Ae:Equivalence eqAProper (PermutationA ==> PermutationA ==> PermutationA) (app (A:=A))A:TypeeqA:relation Ae:Equivalence eqAProper (PermutationA ==> PermutationA ==> PermutationA) (app (A:=A))A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APl:PermutationA l₁ l₂k₁, k₂:list APk:PermutationA k₁ k₂PermutationA (l₁ ++ k₁) (l₂ ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAk₁, k₂:list APk:PermutationA k₁ k₂PermutationA (nil ++ k₁) (nil ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂Pl:PermutationA l₁ l₂k₁, k₂:list APk:PermutationA k₁ k₂IHPl:PermutationA (l₁ ++ k₁) (l₂ ++ k₂)PermutationA ((x₁ :: l₁) ++ k₁) ((x₂ :: l₂) ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA ((y :: x :: l) ++ k₁) ((x :: y :: l) ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list APl1:PermutationA l₁ l₂Pl2:PermutationA l₂ l₃k₁, k₂:list APk:PermutationA k₁ k₂IHPl1:PermutationA (l₁ ++ k₁) (l₂ ++ k₂)IHPl2:PermutationA (l₂ ++ k₁) (l₃ ++ k₂)PermutationA (l₁ ++ k₁) (l₃ ++ k₂)easy.A:TypeeqA:relation Ae:Equivalence eqAk₁, k₂:list APk:PermutationA k₁ k₂PermutationA (nil ++ k₁) (nil ++ k₂)now apply permA_skip.A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂Pl:PermutationA l₁ l₂k₁, k₂:list APk:PermutationA k₁ k₂IHPl:PermutationA (l₁ ++ k₁) (l₂ ++ k₂)PermutationA ((x₁ :: l₁) ++ k₁) ((x₂ :: l₂) ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA ((y :: x :: l) ++ k₁) ((x :: y :: l) ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA ((y :: x :: l) ++ k₁) ?yA:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA ?y ((x :: y :: l) ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA ((y :: x :: l) ++ k₁) ?ynow apply permA_swap.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA (y :: x :: l ++ k₁) ?yA:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA (x :: y :: l ++ k₁) ((x :: y :: l) ++ k₂)now apply PermutationA_app_head.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, k₁, k₂:list APk:PermutationA k₁ k₂PermutationA ((x :: y :: l) ++ k₁) ((x :: y :: l) ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list APl1:PermutationA l₁ l₂Pl2:PermutationA l₂ l₃k₁, k₂:list APk:PermutationA k₁ k₂IHPl1:PermutationA (l₁ ++ k₁) (l₂ ++ k₂)IHPl2:PermutationA (l₂ ++ k₁) (l₃ ++ k₂)PermutationA (l₁ ++ k₁) (l₃ ++ k₂)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list APl1:PermutationA l₁ l₂Pl2:PermutationA l₂ l₃k₁, k₂:list APk:PermutationA k₁ k₂IHPl1:PermutationA (l₁ ++ k₁) (l₂ ++ k₂)IHPl2:PermutationA (l₂ ++ k₁) (l₃ ++ k₂)PermutationA (l₂ ++ k₂) (l₂ ++ k₁)now symmetry. Qed.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list APl1:PermutationA l₁ l₂Pl2:PermutationA l₂ l₃k₁, k₂:list APk:PermutationA k₁ k₂IHPl1:PermutationA (l₁ ++ k₁) (l₂ ++ k₂)IHPl2:PermutationA (l₂ ++ k₁) (l₃ ++ k₂)PermutationA k₂ k₁A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l:list APermutationA l₁ l₂ -> PermutationA (l₁ ++ l) (l₂ ++ l)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l:list APermutationA l₁ l₂ -> PermutationA (l₁ ++ l) (l₂ ++ l)now rewrite E. Qed.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l:list AE:PermutationA l₁ l₂PermutationA (l₁ ++ l) (l₂ ++ l)A:TypeeqA:relation Ae:Equivalence eqAl:list Ax:APermutationA (x :: l) (l ++ x :: nil)A:TypeeqA:relation Ae:Equivalence eqAl:list Ax:APermutationA (x :: l) (l ++ x :: nil)A:TypeeqA:relation Ae:Equivalence eqAx:APermutationA (x :: nil) (nil ++ x :: nil)A:TypeeqA:relation Ae:Equivalence eqAa:Al:list Ax:AIHl:PermutationA (x :: l) (l ++ x :: nil)PermutationA (x :: a :: l) ((a :: l) ++ x :: nil)easy.A:TypeeqA:relation Ae:Equivalence eqAx:APermutationA (x :: nil) (nil ++ x :: nil)A:TypeeqA:relation Ae:Equivalence eqAa:Al:list Ax:AIHl:PermutationA (x :: l) (l ++ x :: nil)PermutationA (x :: a :: l) ((a :: l) ++ x :: nil)A:TypeeqA:relation Ae:Equivalence eqAa:Al:list Ax:AIHl:PermutationA (x :: l) (l ++ x :: nil)PermutationA (x :: a :: l) (a :: l ++ x :: nil)intuition. Qed.A:TypeeqA:relation Ae:Equivalence eqAa:Al:list Ax:AIHl:PermutationA (x :: l) (l ++ x :: nil)PermutationA (x :: a :: l) (a :: x :: l)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA (l₁ ++ l₂) (l₂ ++ l₁)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA (l₁ ++ l₂) (l₂ ++ l₁)A:TypeeqA:relation Ae:Equivalence eqAl₂:list APermutationA (nil ++ l₂) (l₂ ++ nil)A:TypeeqA:relation Ae:Equivalence eqAa:Al₁, l₂:list AIHl₁:PermutationA (l₁ ++ l₂) (l₂ ++ l₁)PermutationA ((a :: l₁) ++ l₂) (l₂ ++ a :: l₁)now rewrite app_nil_r.A:TypeeqA:relation Ae:Equivalence eqAl₂:list APermutationA (nil ++ l₂) (l₂ ++ nil)A:TypeeqA:relation Ae:Equivalence eqAa:Al₁, l₂:list AIHl₁:PermutationA (l₁ ++ l₂) (l₂ ++ l₁)PermutationA ((a :: l₁) ++ l₂) (l₂ ++ a :: l₁)now rewrite PermutationA_cons_append, <-app_assoc. Qed.A:TypeeqA:relation Ae:Equivalence eqAa:Al₁, l₂:list AIHl₁:PermutationA (l₁ ++ l₂) (l₂ ++ l₁)PermutationA ((a :: l₂) ++ l₁) (l₂ ++ a :: l₁)A:TypeeqA:relation Ae:Equivalence eqAl, l₁, l₂:list Ax:APermutationA l (l₁ ++ l₂) -> PermutationA (x :: l) (l₁ ++ x :: l₂)A:TypeeqA:relation Ae:Equivalence eqAl, l₁, l₂:list Ax:APermutationA l (l₁ ++ l₂) -> PermutationA (x :: l) (l₁ ++ x :: l₂)A:TypeeqA:relation Ae:Equivalence eqAl, l₁, l₂:list Ax:AE:PermutationA l (l₁ ++ l₂)PermutationA (x :: l) (l₁ ++ x :: l₂)now rewrite app_comm_cons, (PermutationA_cons_append l₁ x), <- app_assoc. Qed.A:TypeeqA:relation Ae:Equivalence eqAl, l₁, l₂:list Ax:AE:PermutationA l (l₁ ++ l₂)PermutationA (x :: l₁ ++ l₂) (l₁ ++ x :: l₂)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list Ax:APermutationA (x :: l₁ ++ l₂) (l₁ ++ x :: l₂)now apply PermutationA_cons_app. Qed.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list Ax:APermutationA (x :: l₁ ++ l₂) (l₁ ++ x :: l₂)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA l₁ l₂ -> equivlistA eqA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA l₁ l₂ -> equivlistA eqA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAequivlistA eqA nil nilA:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:equivlistA eqA l₁ l₂equivlistA eqA (x₁ :: l₁) (x₂ :: l₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AequivlistA eqA (y :: x :: l) (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃IHPermutationA1:equivlistA eqA l₁ l₂IHPermutationA2:equivlistA eqA l₂ l₃equivlistA eqA l₁ l₃reflexivity.A:TypeeqA:relation Ae:Equivalence eqAequivlistA eqA nil nilnow apply equivlistA_cons_proper.A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:equivlistA eqA l₁ l₂equivlistA eqA (x₁ :: l₁) (x₂ :: l₂)now apply equivlistA_permute_heads.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AequivlistA eqA (y :: x :: l) (x :: y :: l)etransitivity; eassumption. Qed.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃IHPermutationA1:equivlistA eqA l₁ l₂IHPermutationA2:equivlistA eqA l₂ l₃equivlistA eqA l₁ l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list ANoDupA eqA l₁ -> NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list ANoDupA eqA l₁ -> NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APl₁:NoDupA eqA l₁NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAl₁:list APl₁:NoDupA eqA l₁forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAforall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA nil l₂ -> PermutationA nil l₂A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA (x :: l₁) l₂ -> PermutationA (x :: l₁) l₂A:TypeeqA:relation Ae:Equivalence eqAforall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA nil l₂ -> PermutationA nil l₂A:TypeeqA:relation Ae:Equivalence eqAl₂:list AH₂:equivlistA eqA nil l₂PermutationA nil l₂now rewrite (equivlistA_nil_eq eqA).A:TypeeqA:relation Ae:Equivalence eqAl₂:list AH₂:equivlistA eqA l₂ nilPermutationA nil l₂A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA (x :: l₁) l₂ -> PermutationA (x :: l₁) l₂A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂0 : list A, NoDupA eqA l₂0 -> equivlistA eqA l₁ l₂0 -> PermutationA l₁ l₂0l₂:list APl₂:NoDupA eqA l₂E2:equivlistA eqA (x :: l₁) l₂PermutationA (x :: l₁) l₂A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂0 : list A, NoDupA eqA l₂0 -> equivlistA eqA l₁ l₂0 -> PermutationA l₁ l₂0l₂:list APl₂:NoDupA eqA l₂E2:equivlistA eqA (x :: l₁) l₂InA eqA x l₂A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂0 : list A, NoDupA eqA l₂0 -> equivlistA eqA l₁ l₂0 -> PermutationA l₁ l₂0l₂:list APl₂:NoDupA eqA l₂E2:equivlistA eqA (x :: l₁) l₂l₂h:list Ay:Al₂t:list AE3:eqA x yH:l₂ = l₂h ++ y :: l₂tPermutationA (x :: l₁) l₂A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂0 : list A, NoDupA eqA l₂0 -> equivlistA eqA l₁ l₂0 -> PermutationA l₁ l₂0l₂:list APl₂:NoDupA eqA l₂E2:equivlistA eqA (x :: l₁) l₂InA eqA x l₂intuition.A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂0 : list A, NoDupA eqA l₂0 -> equivlistA eqA l₁ l₂0 -> PermutationA l₁ l₂0l₂:list APl₂:NoDupA eqA l₂E2:equivlistA eqA (x :: l₁) l₂InA eqA x (x :: l₁)A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂0 : list A, NoDupA eqA l₂0 -> equivlistA eqA l₁ l₂0 -> PermutationA l₁ l₂0l₂:list APl₂:NoDupA eqA l₂E2:equivlistA eqA (x :: l₁) l₂l₂h:list Ay:Al₂t:list AE3:eqA x yH:l₂ = l₂h ++ y :: l₂tPermutationA (x :: l₁) l₂A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂l₂h:list Ay:Al₂t:list AE2:equivlistA eqA (x :: l₁) (l₂h ++ y :: l₂t)Pl₂:NoDupA eqA (l₂h ++ y :: l₂t)E3:eqA x yPermutationA (x :: l₁) (l₂h ++ y :: l₂t)A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂l₂h:list Ay:Al₂t:list AE2:equivlistA eqA (x :: l₁) (l₂h ++ y :: l₂t)Pl₂:NoDupA eqA (l₂h ++ y :: l₂t)E3:eqA x yPermutationA (y :: l₁) (l₂h ++ y :: l₂t)A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂l₂h:list Ay:Al₂t:list AE2:equivlistA eqA (x :: l₁) (l₂h ++ y :: l₂t)Pl₂:NoDupA eqA (l₂h ++ y :: l₂t)E3:eqA x yNoDupA eqA (l₂h ++ l₂t)A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂l₂h:list Ay:Al₂t:list AE2:equivlistA eqA (x :: l₁) (l₂h ++ y :: l₂t)Pl₂:NoDupA eqA (l₂h ++ y :: l₂t)E3:eqA x yequivlistA eqA l₁ (l₂h ++ l₂t)apply equivlistA_NoDupA_split with x y; intuition. Qed.A:TypeeqA:relation Ae:Equivalence eqAx:Al₁:list AE1:~ InA eqA x l₁Pl₁:NoDupA eqA l₁IHPl₁:forall l₂ : list A, NoDupA eqA l₂ -> equivlistA eqA l₁ l₂ -> PermutationA l₁ l₂l₂h:list Ay:Al₂t:list AE2:equivlistA eqA (x :: l₁) (l₂h ++ y :: l₂t)Pl₂:NoDupA eqA (l₂h ++ y :: l₂t)E3:eqA x yequivlistA eqA l₁ (l₂h ++ l₂t)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AeqlistA eqA l₁ l₂ -> Permutation l₂ l₃ -> exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AeqlistA eqA l₁ l₂ -> Permutation l₂ l₃ -> exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AE:eqlistA eqA l₁ l₂P:Permutation l₂ l₃exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l₃A:TypeeqA:relation Ae:Equivalence eqAl₂, l₃:list AP:Permutation l₂ l₃forall l₁ : list A, eqlistA eqA l₁ l₂ -> exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l₃A:TypeeqA:relation Ae:Equivalence eqAl₁:list AE:eqlistA eqA l₁ nilexists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' nilA:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AP:Permutation l l'IHP:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'l₁:list AE:eqlistA eqA l₁ (x :: l)exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' (x :: l')A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, l₁:list AE:eqlistA eqA l₁ (y :: x :: l)exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AP1:Permutation l l'P2:Permutation l' l''IHP1:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'IHP2:forall l₁0 : list A, eqlistA eqA l₁0 l' -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l''l₁:list AE:eqlistA eqA l₁ lexists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l''A:TypeeqA:relation Ae:Equivalence eqAl₁:list AE:eqlistA eqA l₁ nilexists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' nilnow exists nil.A:TypeeqA:relation Ae:Equivalence eqAl₁:list Aexists l₂' : list A, Permutation nil l₂' /\ eqlistA eqA l₂' nilA:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AP:Permutation l l'IHP:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'l₁:list AE:eqlistA eqA l₁ (x :: l)exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' (x :: l')A:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AP:Permutation l l'IHP:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'l₁:list Ax0:Al0:list AH:eqA x0 xH0:eqlistA eqA l0 lexists l₂' : list A, Permutation (x0 :: l0) l₂' /\ eqlistA eqA l₂' (x :: l')A:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AP:Permutation l l'IHP:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'l₁:list Ax0:Al0:list AH:eqA x0 xH0:eqlistA eqA l0 ll0':list AP':Permutation l0 l0'E':eqlistA eqA l0' l'exists l₂' : list A, Permutation (x0 :: l0) l₂' /\ eqlistA eqA l₂' (x :: l')A:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AP:Permutation l l'l₁:list Ax0:Al0:list AH:eqA x0 xH0:eqlistA eqA l0 ll0':list AP':Permutation l0 l0'E':eqlistA eqA l0' l'exists l₂' : list A, Permutation (x0 :: l0) l₂' /\ eqlistA eqA l₂' (x :: l')split; auto.A:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AP:Permutation l l'l₁:list Ax0:Al0:list AH:eqA x0 xH0:eqlistA eqA l0 ll0':list AP':Permutation l0 l0'E':eqlistA eqA l0' l'Permutation (x0 :: l0) (x0 :: l0') /\ eqlistA eqA (x0 :: l0') (x :: l')A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, l₁:list AE:eqlistA eqA l₁ (y :: x :: l)exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, l₁:list Ax0:Al0:list AH:eqA x0 yH0:eqlistA eqA l0 (x :: l)exists l₂' : list A, Permutation (x0 :: l0) l₂' /\ eqlistA eqA l₂' (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, l₁:list Ax0:Al0:list AH:eqA x0 yx1:Al1:list AH1:eqA x1 xH2:eqlistA eqA l1 lexists l₂' : list A, Permutation (x0 :: x1 :: l1) l₂' /\ eqlistA eqA l₂' (x :: y :: l)now repeat constructor.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al, l₁:list Ax0:Al0:list AH:eqA x0 yx1:Al1:list AH1:eqA x1 xH2:eqlistA eqA l1 lPermutation (x0 :: x1 :: l1) (x1 :: x0 :: l1) /\ eqlistA eqA (x1 :: x0 :: l1) (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AP1:Permutation l l'P2:Permutation l' l''IHP1:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'IHP2:forall l₁0 : list A, eqlistA eqA l₁0 l' -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l''l₁:list AE:eqlistA eqA l₁ lexists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l''A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AIHP1:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'IHP2:forall l₁0 : list A, eqlistA eqA l₁0 l' -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l''l₁:list AE:eqlistA eqA l₁ lexists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l''A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AIHP1:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l'IHP2:forall l₁0 : list A, eqlistA eqA l₁0 l' -> exists l₂' : list A, Permutation l₁0 l₂' /\ eqlistA eqA l₂' l''l₁:list AE:eqlistA eqA l₁ ll₁':list AP₁:Permutation l₁ l₁'E₁:eqlistA eqA l₁' l'exists l₂' : list A, Permutation l₁ l₂' /\ eqlistA eqA l₂' l''A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AIHP1:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂'0 : list A, Permutation l₁0 l₂'0 /\ eqlistA eqA l₂'0 l'IHP2:forall l₁0 : list A, eqlistA eqA l₁0 l' -> exists l₂'0 : list A, Permutation l₁0 l₂'0 /\ eqlistA eqA l₂'0 l''l₁:list AE:eqlistA eqA l₁ ll₁':list AP₁:Permutation l₁ l₁'E₁:eqlistA eqA l₁' l'l₂':list AP₂:Permutation l₁' l₂'E₂:eqlistA eqA l₂' l''exists l₂'0 : list A, Permutation l₁ l₂'0 /\ eqlistA eqA l₂'0 l''A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AIHP1:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂'0 : list A, Permutation l₁0 l₂'0 /\ eqlistA eqA l₂'0 l'IHP2:forall l₁0 : list A, eqlistA eqA l₁0 l' -> exists l₂'0 : list A, Permutation l₁0 l₂'0 /\ eqlistA eqA l₂'0 l''l₁:list AE:eqlistA eqA l₁ ll₁':list AP₁:Permutation l₁ l₁'E₁:eqlistA eqA l₁' l'l₂':list AP₂:Permutation l₁' l₂'E₂:eqlistA eqA l₂' l''Permutation l₁ l₂' /\ eqlistA eqA l₂' l''econstructor; eauto. Qed.A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AIHP1:forall l₁0 : list A, eqlistA eqA l₁0 l -> exists l₂'0 : list A, Permutation l₁0 l₂'0 /\ eqlistA eqA l₂'0 l'IHP2:forall l₁0 : list A, eqlistA eqA l₁0 l' -> exists l₂'0 : list A, Permutation l₁0 l₂'0 /\ eqlistA eqA l₂'0 l''l₁:list AE:eqlistA eqA l₁ ll₁':list AP₁:Permutation l₁ l₁'E₁:eqlistA eqA l₁' l'l₂':list AP₂:Permutation l₁' l₂'E₂:eqlistA eqA l₂' l''Permutation l₁ l₂'A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA l₁ l₂ -> exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₂A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA l₁ l₂ -> exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₂A:TypeeqA:relation Ae:Equivalence eqAexists l : list A, Permutation nil l /\ eqlistA eqA l nilA:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₂exists l : list A, Permutation (x₁ :: l₁) l /\ eqlistA eqA l (x₂ :: l₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list Aexists l0 : list A, Permutation (y :: x :: l) l0 /\ eqlistA eqA l0 (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃IHPermutationA1:exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₂IHPermutationA2:exists l : list A, Permutation l₂ l /\ eqlistA eqA l l₃exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₃now exists nil.A:TypeeqA:relation Ae:Equivalence eqAexists l : list A, Permutation nil l /\ eqlistA eqA l nilA:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₂exists l : list A, Permutation (x₁ :: l₁) l /\ eqlistA eqA l (x₂ :: l₂)exists (x₁::l); auto.A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂l:list AP:Permutation l₁ lE:eqlistA eqA l l₂exists l0 : list A, Permutation (x₁ :: l₁) l0 /\ eqlistA eqA l0 (x₂ :: l₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list Aexists l0 : list A, Permutation (y :: x :: l) l0 /\ eqlistA eqA l0 (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list APermutation (y :: x :: l) (x :: y :: l) /\ eqlistA eqA (x :: y :: l) (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list APermutation (y :: x :: l) (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AeqlistA eqA (x :: y :: l) (x :: y :: l)reflexivity.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AeqlistA eqA (x :: y :: l) (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃IHPermutationA1:exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₂IHPermutationA2:exists l : list A, Permutation l₂ l /\ eqlistA eqA l l₃exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃l₁':list AP:Permutation l₁ l₁'E:eqlistA eqA l₁' l₂IHPermutationA2:exists l : list A, Permutation l₂ l /\ eqlistA eqA l l₃exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃l₁':list AP:Permutation l₁ l₁'E:eqlistA eqA l₁' l₂l₂':list AP':Permutation l₂ l₂'E':eqlistA eqA l₂' l₃exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃l₁':list AP:Permutation l₁ l₁'E:eqlistA eqA l₁' l₂l₂':list AP':Permutation l₂ l₂'E':eqlistA eqA l₂' l₃l₁'':list AP'':Permutation l₁' l₁''E'':eqlistA eqA l₁'' l₂'exists l : list A, Permutation l₁ l /\ eqlistA eqA l l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃l₁':list AP:Permutation l₁ l₁'E:eqlistA eqA l₁' l₂l₂':list AP':Permutation l₂ l₂'E':eqlistA eqA l₂' l₃l₁'':list AP'':Permutation l₁' l₁''E'':eqlistA eqA l₁'' l₂'Permutation l₁ l₁'' /\ eqlistA eqA l₁'' l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃l₁':list AP:Permutation l₁ l₁'E:eqlistA eqA l₁' l₂l₂':list AP':Permutation l₂ l₂'E':eqlistA eqA l₂' l₃l₁'':list AP'':Permutation l₁' l₁''E'':eqlistA eqA l₁'' l₂'Permutation l₁ l₁''A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃l₁':list AP:Permutation l₁ l₁'E:eqlistA eqA l₁' l₂l₂':list AP':Permutation l₂ l₂'E':eqlistA eqA l₂' l₃l₁'':list AP'':Permutation l₁' l₁''E'':eqlistA eqA l₁'' l₂'eqlistA eqA l₁'' l₃now transitivity l₂'. Qed.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃l₁':list AP:Permutation l₁ l₁'E:eqlistA eqA l₁' l₂l₂':list AP':Permutation l₂ l₂'E':eqlistA eqA l₂' l₃l₁'':list AP'':Permutation l₁' l₁''E'':eqlistA eqA l₁'' l₂'eqlistA eqA l₁'' l₃A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutation l₁ l₂ -> PermutationA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutation l₁ l₂ -> PermutationA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAPermutationA nil nilA:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AH:Permutation l l'IHPermutation:PermutationA l l'PermutationA (x :: l) (x :: l')A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list APermutationA (y :: x :: l) (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AH:Permutation l l'H0:Permutation l' l''IHPermutation1:PermutationA l l'IHPermutation2:PermutationA l' l''PermutationA l l''constructor.A:TypeeqA:relation Ae:Equivalence eqAPermutationA nil nilnow constructor.A:TypeeqA:relation Ae:Equivalence eqAx:Al, l':list AH:Permutation l l'IHPermutation:PermutationA l l'PermutationA (x :: l) (x :: l')apply permA_swap.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list APermutationA (y :: x :: l) (x :: y :: l)econstructor; eauto. Qed.A:TypeeqA:relation Ae:Equivalence eqAl, l', l'':list AH:Permutation l l'H0:Permutation l' l''IHPermutation1:PermutationA l l'IHPermutation2:PermutationA l' l''PermutationA l l''A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list AeqlistA eqA l₁ l₂ -> PermutationA l₁ l₂induction 1; now constructor. Qed.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list AeqlistA eqA l₁ l₂ -> PermutationA l₁ l₂A:TypeeqA:relation Ae:Equivalence eqAl1, l2:list ANoDupA eqA l1 -> NoDupA eqA l2 -> equivlistA eqA l1 l2 -> exists l : list A, Permutation l1 l /\ eqlistA eqA l l2A:TypeeqA:relation Ae:Equivalence eqAl1, l2:list ANoDupA eqA l1 -> NoDupA eqA l2 -> equivlistA eqA l1 l2 -> exists l : list A, Permutation l1 l /\ eqlistA eqA l l2A:TypeeqA:relation Ae:Equivalence eqAl1, l2:list AH:NoDupA eqA l1H0:NoDupA eqA l2H1:equivlistA eqA l1 l2exists l : list A, Permutation l1 l /\ eqlistA eqA l l2now apply NoDupA_equivlistA_PermutationA. Qed.A:TypeeqA:relation Ae:Equivalence eqAl1, l2:list AH:NoDupA eqA l1H0:NoDupA eqA l2H1:equivlistA eqA l1 l2PermutationA l1 l2A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA l₁ l₂ -> NoDupA eqA l₁ -> NoDupA eqA l₂A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂:list APermutationA l₁ l₂ -> NoDupA eqA l₁ -> NoDupA eqA l₂A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:NoDupA eqA l₁ -> NoDupA eqA l₂NoDupA eqA (x₁ :: l₁) -> NoDupA eqA (x₂ :: l₂)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list ANoDupA eqA (y :: x :: l) -> NoDupA eqA (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃IHPermutationA1:NoDupA eqA l₁ -> NoDupA eqA l₂IHPermutationA2:NoDupA eqA l₂ -> NoDupA eqA l₃NoDupA eqA l₁ -> NoDupA eqA l₃A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:NoDupA eqA l₁ -> NoDupA eqA l₂NoDupA eqA (x₁ :: l₁) -> NoDupA eqA (x₂ :: l₂)A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:PermutationA l₁ l₂IHPermutationA:NoDupA eqA l₁ -> NoDupA eqA l₂H2:~ InA eqA x₁ l₁H3:NoDupA eqA l₁~ InA eqA x₂ l₂A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:equivlistA eqA l₁ l₂IHPermutationA:NoDupA eqA l₁ -> NoDupA eqA l₂H2:~ InA eqA x₁ l₁H3:NoDupA eqA l₁~ InA eqA x₂ l₂now rewrite H, H0.A:TypeeqA:relation Ae:Equivalence eqAx₁, x₂:Al₁, l₂:list AH:eqA x₁ x₂H0:equivlistA eqA l₁ l₂IHPermutationA:NoDupA eqA l₁ -> NoDupA eqA l₂H3:NoDupA eqA l₁H2:InA eqA x₂ l₂InA eqA x₁ l₁A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list ANoDupA eqA (y :: x :: l) -> NoDupA eqA (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H1:NoDupA eqA (x :: l)NoDupA eqA (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H:~ InA eqA x lH2:NoDupA eqA lNoDupA eqA (x :: y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H:~ InA eqA x lH2:NoDupA eqA l~ InA eqA x (y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H:~ InA eqA x lH2:NoDupA eqA lNoDupA eqA (y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H:~ InA eqA x lH2:NoDupA eqA l~ InA eqA x (y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H2:NoDupA eqA lH:InA eqA x (y :: l)InA eqA x lA:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H2:NoDupA eqA lH1:eqA x yInA eqA x lnow constructor.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H2:NoDupA eqA lH1:eqA x yInA eqA y (x :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H:~ InA eqA x lH2:NoDupA eqA lNoDupA eqA (y :: l)A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH0:~ InA eqA y (x :: l)H:~ InA eqA x lH2:NoDupA eqA l~ InA eqA y lnow apply InA_cons_tl.A:TypeeqA:relation Ae:Equivalence eqAx, y:Al:list AH:~ InA eqA x lH2:NoDupA eqA lH0:InA eqA y lInA eqA y (x :: l)eauto. Qed. End Permutation.A:TypeeqA:relation Ae:Equivalence eqAl₁, l₂, l₃:list AH:PermutationA l₁ l₂H0:PermutationA l₂ l₃IHPermutationA1:NoDupA eqA l₁ -> NoDupA eqA l₂IHPermutationA2:NoDupA eqA l₂ -> NoDupA eqA l₃NoDupA eqA l₁ -> NoDupA eqA l₃