proposition: Lemma spanning_tree_root_reachable_by: forall (g1 g2: Graph) (e: E) (root: V) (P: V -> Prop), out_edges g1 root e -> vvalid g1 root -> P root -> ReachDecidable g1 (dst g1 e) (fun x => P x /\ x <> root) -> spanning_tree g1 (dst g1 e) (fun x => P x /\ x <> root) g2 -> Included (reachable_by g2 root P) (reachable_by g1 root P).
proof: Proof. intros. hnf. unfold Ensembles.In. intros. destruct (X x). + assert (g1 |= dst g1 e ~o~> x satisfying P). { apply reachable_by_weaken with (fun x => P x /\ x <> root); auto. hnf. unfold Ensembles.In . intuition. } apply edge_reachable_by with (dst g1 e); auto. apply reachable_by_head_valid in H4. do 2 (split; auto). rewrite step_spec. destruct H. exists e; auto. + destruct H3 as [p ?]. assert (forall v, In_path g2 v p -> ~ g1 |= dst g1 e ~o~> v satisfying (fun x0 : V => P x0 /\ x0 <> root)). { intros. intro. destruct H2 as [_ [_ [_ ?]]]. specialize (H2 v x H5 n). apply H2. apply (reachable_path_in' g2 p root); auto. clear -H3. destruct H3 as [? [? ?]]. do 2 (split; auto). rewrite path_prop_equiv; auto. } exists p. destruct H2 as [? _]. symmetry in H2. apply (ppg_reachable_by_path_to g2 g1 _ _ p root x H2 H4); 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