proposition: Lemma list_first_prop: forall {A} (n : A) (l : list A) (s : A) (P: A -> Prop), P n -> ~ P s -> In s l -> exists l1 l2 n1 n2, P n1 /\ ~ P n2 /\ n :: l = l1 ++ n1 :: n2 :: l2.
proof: Proof. intros. revert n H. induction l. inversion H1. simpl in H1. intros. destruct H1. + subst a. exists nil, l, n, s. split; auto. + destruct (classic (P a)). - specialize (IHl H1 a H2). destruct IHl as [l1 [l2 [n1 [n2 [? [? ?]]]]]]. exists (n :: l1), l2, n1, n2. do 2 (split; auto). rewrite H5. rewrite <- app_comm_cons. auto. - exists nil, l, n, a. split; auto. Qed.
imports: Coq.Classes.Morphisms CertiGraph.lib.Coqlib CertiGraph.lib.EquivDec_ext CertiGraph.lib.EnumEnsembles CertiGraph.lib.List_ext CertiGraph.lib.relation_list CertiGraph.graph.graph_model CertiGraph.graph.path_lemmas CertiGraph.graph.graph_gen CertiGraph.graph.graph_relation CertiGraph.graph.subgraph2 CertiGraph.graph.reachable_ind Coq.Logic.Classical