Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions theories/Sorting/Permutation.v
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,17 @@ Proof.
inversion_clear HF1; auto.
Qed.

#[export] Instance Permutation_filter (f : A -> bool) :
Proper (@Permutation _ ==> @Permutation _) (filter f).
Proof.
intros l l' H.
induction H; simpl;
repeat match goal with
| |- context[if ?x then _ else _] => destruct x
end;
eauto.
Qed.

Lemma Permutation_Forall2 (P : A -> B -> Prop) :
forall l1 l1' (l2 : list B), Permutation l1 l1' -> Forall2 P l1 l2 ->
exists l2' : list B, Permutation l2 l2' /\ Forall2 P l1' l2'.
Expand Down
Loading