File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed
Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,13 @@ Section lazy_list.
77 | lnil : llist
88 | lcons : T -> (unit -> llist) -> llist.
99
10- End lazy_list.
10+ Fixpoint force (l : llist) : list T :=
11+ match l with
12+ | lnil => nil
13+ | lcons a b => cons a (force (b tt))
14+ end .
15+
16+ End lazy_list.
17+
18+ Arguments lnil {T}.
19+ Arguments lcons {T} _ _.
Original file line number Diff line number Diff line change @@ -201,6 +201,22 @@ Global Instance Injective_nil_nil T : Injective (nil = @nil T) :=
201201auto.
202202Defined .
203203
204+ Global Instance Injective_app_cons {T} (a : list T) b c d
205+ : Injective (a ++ b :: nil = (c ++ d :: nil)) :=
206+ { result := a = c /\ b = d }.
207+ Proof . eapply app_inj_tail. Defined .
208+
209+ Global Instance Injective_app_same_L {T} (a : list T) b c
210+ : Injective (b ++ a = b ++ c) :=
211+ { result := a = c }.
212+ Proof . apply app_inv_head. Defined .
213+
214+ Global Instance Injective_app_same_R {T} (a : list T) b c
215+ : Injective (a ++ b = c ++ b) :=
216+ { result := a = c }.
217+ Proof . apply app_inv_tail. Defined .
218+
219+
204220Lemma eq_list_eq
205221: forall T (a b : T) (pf : a = b) (F : _ -> Type) val,
206222 match pf in _ = x return list (F x) with
Original file line number Diff line number Diff line change @@ -77,11 +77,27 @@ Proof.
7777 intros. setoid_rewrite H. reflexivity.
7878Qed .
7979
80+ Lemma forall_impl : forall {T} (P Q : T -> Prop),
81+ (forall x, P x -> Q x) ->
82+ (forall x, P x) -> (forall x, Q x).
83+ Proof .
84+ clear. intuition.
85+ Qed .
86+
87+
8088(** Exists * *)
8189Lemma exists_iff : forall T P Q,
8290 (forall x,
8391 P x <-> Q x) ->
8492 ((exists x : T, P x) <-> (exists x : T, Q x)).
8593Proof .
8694 intros. setoid_rewrite H. reflexivity.
87- Qed .
95+ Qed .
96+
97+ Lemma exists_impl : forall {T} (P Q : T -> Prop),
98+ (forall x, P x -> Q x) ->
99+ (exists x, P x) -> (exists x, Q x).
100+ Proof .
101+ clear. intuition.
102+ destruct H0; eauto.
103+ Qed .
You can’t perform that action at this time.
0 commit comments