Local Notation Forall := (@Forall A).

(* Specifications: *)
Lemma map_ext_Forall B : forall (f g : A -> B) l,
Forall (fun x => f x = g x) l -> map f l = map g l.
Theorem Exists_impl : forall (P Q : A -> Prop), (forall a : A, P a -> Q a) ->
forall l, Exists P l -> Exists Q l.
Lemma Exists_or : forall (P Q : A -> Prop) l,
Exists P l \/ Exists Q l -> Exists (fun x => P x \/ Q x) l.
Lemma Exists_or_inv : forall (P Q : A -> Prop) l,
Exists (fun x => P x \/ Q x) l -> Exists P l \/ Exists Q l.
Lemma Forall_impl : forall (P Q : A -> Prop), (forall a, P a -> Q a) ->
forall l, Forall P l -> Forall Q l.
Lemma Forall_and : forall (P Q : A -> Prop) l,
Forall P l -> Forall Q l -> Forall (fun x => P x /\ Q x) l.
Lemma Forall_and_inv : forall (P Q : A -> Prop) l,
Forall (fun x => P x /\ Q x) l -> Forall P l /\ Forall Q l.
Lemma Forall_Exists_neg (P:A->Prop)(l:list A) :
Forall (fun x => ~ P x) l <-> ~(Exists P l).
Lemma Exists_Forall_neg (P:A->Prop)(l:list A) :
(forall x, P x \/ ~P x) ->
Exists (fun x => ~ P x) l <-> ~(Forall P l).
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.
Lemma Forall_Exists_dec (P:A->Prop) :
(forall x:A, {P x} + { ~ P x }) ->
forall l:list A,
{Forall P l} + {Exists (fun x => ~ P x) l}.
Lemma Exists_concat A P (ls : list (list A)) :
Exists P (concat ls) <-> Exists (Exists P) ls.
Lemma Exists_flat_map A B P ls (f : A -> list B) :
Exists P (flat_map f ls) <-> Exists (fun d => Exists P (f d)) ls.
Lemma Forall_map A B (f : A -> B) P l :
Forall P (map f l) <-> Forall (fun x => P (f x)) l.
Lemma Forall_concat A P (ls : list (list A)) :
Forall P (concat ls) <-> Forall (Forall P) ls.
Lemma Forall_flat_map A B P ls (f : A -> list B) :
Forall P (flat_map f ls) <-> Forall (fun d => Forall P (f d)) ls.
Lemma exists_Forall A B : forall (P : A -> B -> Prop) l,
(exists k, Forall (P k) l) -> Forall (fun x => exists k, P k x) l.
Lemma Forall_image A B : forall (f : A -> B) l,
Forall (fun y => exists x, y = f x) l <-> exists l', l = map f l'.
Lemma concat_nil_Forall A : forall (l : list (list A)),
concat l = [] <-> Forall (fun x => x = []) l.
Lemma in_flat_map_Exists A B : forall (f : A -> list B) x l,
In x (flat_map f l) <-> Exists (fun y => In x (f y)) l.
Lemma notin_flat_map_Forall A B : forall (f : A -> list B) x l,
~ In x (flat_map f l) <-> Forall (fun y => ~ In x (f y)) l.