proposition: Lemma Complement_reachable_by_through_app_strong: forall (g: PreGraph V E) P l1 l2, Same_set (Complement _ (reachable_by_through_set g (l1 ++ l2) P)) (Intersection _ (Complement _ (reachable_by_through_set g l1 P)) (Complement _ (reachable_by_through_set (predicate_partialgraph g (Complement _ (reachable_by_through_set g l1 P))) l2 P))).
proof: Proof. intros. rewrite Same_set_spec; intro n. rewrite Intersection_spec; unfold Complement, Ensembles.In. rewrite reachable_by_through_app. split; intros. + split; [tauto |]. rewrite reachable_by_through_set_eq_partialgraph_reachable_through_set, partial_partialgraph, Intersection_comm, <- partial_partialgraph, <- reachable_by_through_set_eq_partialgraph_reachable_through_set. intro. apply reachable_by_through_set_is_reachable_through_set in H0. rewrite <- reachable_by_through_set_eq_partialgraph_reachable_through_set in H0. tauto. + destruct H. intros [? | ?]; [tauto |]. apply H0; clear H0. rewrite reachable_by_through_set_eq_partialgraph_reachable_through_set in H, H1 |- *. rewrite partial_partialgraph, Intersection_comm, <- partial_partialgraph, <- reachable_by_through_set_eq_partialgraph_reachable_through_set. assert (Same_set (fun x : V => ~ reachable_by_through_set g l1 P x) (Complement _ (reachable_through_set (predicate_partialgraph g P) l1))). 1: { rewrite Same_set_spec; intro v. pose proof reachable_by_through_set_eq_partialgraph_reachable_through_set g P l1 v. unfold Complement, Ensembles.In; tauto. } rewrite H0; clear H0. remember (predicate_partialgraph g P) as g'. clear g Heqg'. apply edge_preserved_rev_foot0; auto. intros; eapply reachable_through_set_reachable; eauto. Qed.
imports: Coq.Arith.Arith Coq.Logic.ProofIrrelevance Coq.Logic.FunctionalExtensionality Coq.Classes.Morphisms Coq.Classes.Equivalence CertiGraph.lib.Coqlib CertiGraph.lib.Ensembles_ext CertiGraph.lib.relation_list CertiGraph.lib.List_ext CertiGraph.lib.Equivalence_ext CertiGraph.lib.EquivDec_ext VST.msl.Coqlib2 CertiGraph.graph.graph_model CertiGraph.graph.path_lemmas CertiGraph.graph.reachable_ind CertiGraph.graph.graph_gen CertiGraph.graph.graph_relation