aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/NonEmpty.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/NonEmpty.v')
-rw-r--r--src/common/NonEmpty.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/NonEmpty.v b/src/common/NonEmpty.v
index 2169306..24a29a3 100644
--- a/src/common/NonEmpty.v
+++ b/src/common/NonEmpty.v
@@ -326,3 +326,15 @@ Proof.
- constructor.
- clear H. inv H1; intuition (constructor; auto).
Qed.
+
+Lemma In_map2 :
+ forall A B (f: A -> B) n (x: B),
+ In x (map f n) ->
+ exists y, In y n /\ x = f y.
+Proof.
+ induction n; inversion 1; subst; cbn in *.
+ - inv H. exists a; split; auto. constructor.
+ - clear H. inv H1.
+ + exists a; split; auto; constructor; tauto.
+ + exploit IHn; eauto; simplify. exists x0; split; auto; constructor; tauto.
+Qed.