Skip to content

Commit 229e122

Browse files
author
Gregory Malecha
committed
moving some lemmas.
1 parent 1278812 commit 229e122

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

theories/Data/LazyList.v

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff 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} _ _.

theories/Data/List.v

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,22 @@ Global Instance Injective_nil_nil T : Injective (nil = @nil T) :=
201201
auto.
202202
Defined.
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+
204220
Lemma 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

theories/Data/Prop.v

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,27 @@ Proof.
7777
intros. setoid_rewrite H. reflexivity.
7878
Qed.
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 **)
8189
Lemma 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)).
8593
Proof.
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.

0 commit comments

Comments
 (0)