I need to proove that a secondary definition of permutation is equivalent to the default definition of permutation in Coq:
Down bellow is the default Permutation definition in Coq
Inductive Permutation : list A -> list A -> Prop :=
| perm_nil: Permutation [] []
| perm_skip x l l' : Permutation l l' -> Permutation (x::l) (x::l')
| perm_swap x y l : Permutation (y::x::l) (x::y::l)
| perm_trans l l' l'' :
Permutation l l' -> Permutation l' l'' -> Permutation l l''.
I need to prove that the above mentioned definition is equivalent to the following definition:
Definition perm l l' := forall x, occurences_number x l = occurences_number x l'.
Which as you have noticed uses the definition occurences_number down bellow:
Fixpoint occurences_number x l := match l with
| nil => 0
| h::tl => if (x =? h) then S(occurences_number x tl) else occurences_number x tl
end.
What I need to prove indeed is the following:
Lemma permutation_to_perm: forall l l', Permutation l l' -> perm l l'.
Down bellow is my incomplete proof
Proof.
induction l.
- admit.
- intros l' Hequiv.
generalize dependent a.
generalize dependent l.
case l'.
+ Admitted.