From 996f75a7526591f89160b2df1d52cd5075696618 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 2 Jun 2023 15:48:06 +0100 Subject: Finished the propert version of from_predicated_sem_pred_expr2 --- src/common/NonEmpty.v | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/common') 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. -- cgit