proposition: Lemma pfoot_spec: forall g p n, pfoot g p = n <-> p = (n, nil) \/ exists v l e, p = (v, l +:: e) /\ dst g e = n.
proof: Proof. intros. destruct p as [h p]. revert h. induction p; intros; split; intros. + simpl in H. subst; left; auto. + simpl in *. destruct H. 1: inversion H; auto. destruct H as [? [? [? [? ?]]]]. inversion H. destruct x0; inversion H3. + right. rewrite pfoot_cons in H. rewrite IHp in H. destruct H. - inversion H. subst p. exists h, nil, a. simpl. auto. - destruct H as [v [l [e [? ?]]]]. inversion H. exists h, (a :: l), e. simpl. auto. + destruct H. inversion H. destruct H as [v [l [e [? ?]]]]. rewrite pfoot_cons. rewrite IHp. destruct l. - simpl in H. inversion H. subst. left; auto. - simpl in H. right. exists (dst g a), l, e. inversion H. auto. Qed.
imports: Coq.Logic.ProofIrrelevance Coq.micromega.Lia CertiGraph.lib.Coqlib CertiGraph.lib.EnumEnsembles CertiGraph.lib.List_ext CertiGraph.lib.EquivDec_ext CertiGraph.graph.graph_model Coq.Lists.List Coq.Lists.ListDec