From 9043add656177eeac1491a73d2f3ab92bec0013c Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 29 Dec 2018 14:31:27 -0500 Subject: Imported Upstream version 8.8.2 --- theories/Lists/List.v | 42 +++++++++++++++++++++++--------------- theories/Lists/ListDec.v | 10 +++++---- theories/Lists/ListSet.v | 10 +++++---- theories/Lists/ListTactics.v | 10 +++++---- theories/Lists/SetoidList.v | 16 ++++++++------- theories/Lists/SetoidPermutation.v | 16 ++++++++------- theories/Lists/StreamMemo.v | 10 +++++---- theories/Lists/Streams.v | 12 ++++++----- theories/Lists/vo.itarget | 8 -------- 9 files changed, 75 insertions(+), 59 deletions(-) delete mode 100644 theories/Lists/vo.itarget (limited to 'theories/Lists') diff --git a/theories/Lists/List.v b/theories/Lists/List.v index 30f1dec2..ca5f154e 100644 --- a/theories/Lists/List.v +++ b/theories/Lists/List.v @@ -1,9 +1,11 @@ (************************************************************************) -(* v * The Coq Proof Assistant / The Coq Development Team *) -(* l = []. Proof. split. - - destruct l as [|a l' _]. + - destruct l as [|a l']. * intuition. * simpl. destruct (f a), (partition l'); now intros [= -> ->]. - now intros ->. @@ -2110,13 +2111,13 @@ Section Exists_Forall. {Exists l} + {~ Exists l}. Proof. intro Pdec. induction l as [|a l' Hrec]. - - right. now rewrite Exists_nil. + - right. abstract now rewrite Exists_nil. - destruct Hrec as [Hl'|Hl']. * left. now apply Exists_cons_tl. * destruct (Pdec a) as [Ha|Ha]. + left. now apply Exists_cons_hd. - + right. now inversion_clear 1. - Qed. + + right. abstract now inversion 1. + Defined. Inductive Forall : list A -> Prop := | Forall_nil : Forall nil @@ -2152,9 +2153,9 @@ Section Exists_Forall. - destruct Hrec as [Hl'|Hl']. + destruct (Pdec a) as [Ha|Ha]. * left. now apply Forall_cons. - * right. now inversion_clear 1. - + right. now inversion_clear 1. - Qed. + * right. abstract now inversion 1. + + right. abstract now inversion 1. + Defined. End One_predicate. @@ -2179,6 +2180,16 @@ Section Exists_Forall. * now apply Exists_cons_hd. Qed. + Lemma neg_Forall_Exists_neg (P:A->Prop) (l:list A) : + (forall x:A, {P x} + { ~ P x }) -> + ~ Forall P l -> + Exists (fun x => ~ P x) l. + Proof. + intro Dec. + apply Exists_Forall_neg; intros. + destruct (Dec x); auto. + Qed. + Lemma Forall_Exists_dec (P:A->Prop) : (forall x:A, {P x} + { ~ P x }) -> forall l:list A, @@ -2186,9 +2197,8 @@ Section Exists_Forall. Proof. intros Pdec l. destruct (Forall_dec P Pdec l); [left|right]; trivial. - apply Exists_Forall_neg; trivial. - intro x. destruct (Pdec x); [now left|now right]. - Qed. + now apply neg_Forall_Exists_neg. + Defined. Lemma Forall_impl : forall (P Q : A -> Prop), (forall a, P a -> Q a) -> forall l, Forall P l -> Forall Q l. diff --git a/theories/Lists/ListDec.v b/theories/Lists/ListDec.v index 3e2eeac0..e7e2cfc8 100644 --- a/theories/Lists/ListDec.v +++ b/theories/Lists/ListDec.v @@ -1,9 +1,11 @@ (************************************************************************) -(* v * The Coq Proof Assistant / The Coq Development Team *) -(* Prop) (S:Stream A), ForAll (fun s => P (map s)) S <-> ForAll P (map S). Proof. intros P S. -split; generalize S; clear S; cofix; intros S; constructor; +split; generalize S; clear S; cofix ForAll_map; intros S; constructor; destruct H as [H0 H]; firstorder. Qed. diff --git a/theories/Lists/vo.itarget b/theories/Lists/vo.itarget deleted file mode 100644 index 82dd1be8..00000000 --- a/theories/Lists/vo.itarget +++ /dev/null @@ -1,8 +0,0 @@ -ListSet.vo -ListTactics.vo -List.vo -ListDec.vo -SetoidList.vo -SetoidPermutation.vo -StreamMemo.vo -Streams.vo -- cgit v1.2.3