proposition: Lemma Invariance1: forall x, invariant (Forall_reachable x).
proof: Proof. unfold Forall_reachable. intros; intros len g l r. simpl. intros. rewrite Forall_forall in *. intro y; intros; simpl in *. rewrite in_app_iff in H1. destruct H1. + pose proof new_working_list_sublist l (map (dst G) (edge_func G g)) (g :: r) y H1. rewrite in_app_iff in H2. destruct H2; [apply H0; right; rewrite in_app_iff; tauto |]. rewrite <- edge_func_step in H2. apply reachable_step with g; auto. rewrite step_spec in H2. destruct H2 as [e [? [? ?]]]. apply (valid_graph G) in H2. rewrite H4 in H2. destruct H2 as [_ [? | ?]]; auto. rewrite in_new_working_list in H1. tauto. + apply H0. destruct H1; [left | right]; auto. rewrite in_app_iff; tauto. Qed.
imports: Coq.Sets.Finite_sets Coq.Arith.Arith Coq.Logic.ProofIrrelevance Coq.Logic.FunctionalExtensionality Coq.Sorting.Permutation Coq.micromega.Lia CertiGraph.lib.Coqlib CertiGraph.lib.List_ext CertiGraph.lib.EquivDec_ext CertiGraph.lib.EnumEnsembles Coq.Lists.List VST.msl.Coqlib2 CertiGraph.graph.graph_model CertiGraph.graph.path_lemmas CertiGraph.graph.reachable_ind CertiGraph.graph.subgraph2 CertiGraph.graph.graph_gen CertiGraph.graph.MathGraph CertiGraph.graph.FiniteGraph