Skip to content

Commit

Permalink
Add PermutationMaybeNilFlatMap
Browse files Browse the repository at this point in the history
  • Loading branch information
norm2782 committed Jun 29, 2012
1 parent b11b14a commit 8144f36
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/ListLemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ Proof.
simpl. apply Permutation_app_head. apply IHPermutation.
simpl. do 2 rewrite -> app_assoc.
apply Permutation_app_tail. apply Permutation_app_comm.
generalize IHPermutation2.
generalize IHPermutation1.
generalize IHPermutation1, IHPermutation2.
apply Permutation_trans.
Qed.

Expand Down Expand Up @@ -258,4 +257,12 @@ Qed.

Lemma NotInApp : forall (a : Type) (x : a) (xs ys : list a),
~In x xs -> ~In x ys -> ~In x (xs ++ ys).
Proof. Admitted.
Proof. Admitted.Lemma PermutationMaybeNilFlatMap : forall (a b c : Type) (ox oy : option c) (g h : a -> list c) (f : c -> list c) (xs ys : list a),
Permutation (flat_map g xs) (flat_map h ys) ->
Permutation (maybe nil f ox ++ flat_map g xs) (maybe nil f ox ++ flat_map h ys).
Proof.
intros a b c ox oy g h f xs ys H.
destruct ox as [cx |].
simpl. apply Permutation_app_head. assumption.
simpl. assumption.
Qed.

0 comments on commit 8144f36

Please sign in to comment.