proposition: Lemma Exists_inv_middle_first : forall P l, Exists P l -> exists l1 x l2, l = l1++x::l2 /\ Forall (fun x => ~ P x) l1 /\ P x.
proof: Proof. Proof using. introv E. induction E. exists (@nil A) x l. splits~. constructors~. lets (l1&x'&l2&E1&F&HP): (rm IHE). tests Px: (P x). exists (@nil A) x l. splits~. constructors~. substs. exists (x :: l1) x' l2. splits~. constructors~. Qed.
imports: Coq.Classes.Morphisms TLC(LibTactics LibLogic LibReflect LibOperation LibProd LibOption LibNat LibInt LibWf LibMonoid LibRelation)