From 30446765297d79767b68e4a5f5b9160171b63b72 Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Sun, 9 Nov 2014 11:55:00 -0500 Subject: Add a [map_ext_in] lemma to List.v. Slightly broader version of the existing [map_ext]: two [map] expressions are equal if their respective functions agree on all arguments that are in the list being mapped. --- theories/Lists/List.v | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'theories/Lists') diff --git a/theories/Lists/List.v b/theories/Lists/List.v index 3cba090f3..00406f57d 100644 --- a/theories/Lists/List.v +++ b/theories/Lists/List.v @@ -1021,6 +1021,13 @@ Proof. rewrite H; rewrite IHl; auto. Qed. +Lemma map_ext_in : + forall (A B : Type)(f g:A->B) l, (forall a, In a l -> f a = g a) -> map f l = map g l. +Proof. + induction l; simpl; auto. + intros; rewrite H by intuition; rewrite IHl; auto. +Qed. + (************************************) (** Left-to-right iterator on lists *) -- cgit v1.2.3