aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Lists
diff options
context:
space:
mode:
authorGravatar Nickolai Zeldovich <nickolai@csail.mit.edu>2014-11-09 18:32:55 -0500
committerGravatar Pierre Letouzey <pierre.letouzey@inria.fr>2015-04-09 12:34:09 +0200
commiteaa3f9719d6190ba92ce55816f11c70b30434309 (patch)
treeb46fc5c0433a3b1202373067e3cb8c78b96a39fc /theories/Lists
parent30446765297d79767b68e4a5f5b9160171b63b72 (diff)
Prove [map_ext] using [map_ext_in].
Since [map_ext_in] is more general, no need to have the same proof twice.
Diffstat (limited to 'theories/Lists')
-rw-r--r--theories/Lists/List.v13
1 files changed, 6 insertions, 7 deletions
diff --git a/theories/Lists/List.v b/theories/Lists/List.v
index 00406f57d..ea07a8497 100644
--- a/theories/Lists/List.v
+++ b/theories/Lists/List.v
@@ -1014,13 +1014,6 @@ Proof.
rewrite IHl; auto.
Qed.
-Lemma map_ext :
- forall (A B : Type)(f g:A->B), (forall a, f a = g a) -> forall l, map f l = map g l.
-Proof.
- induction l; simpl; auto.
- 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.
@@ -1028,6 +1021,12 @@ Proof.
intros; rewrite H by intuition; rewrite IHl; auto.
Qed.
+Lemma map_ext :
+ forall (A B : Type)(f g:A->B), (forall a, f a = g a) -> forall l, map f l = map g l.
+Proof.
+ intros; apply map_ext_in; auto.
+Qed.
+
(************************************)
(** Left-to-right iterator on lists *)