proposition: Lemma triple_final: forall root l (g g1: Graph), vvalid g root -> (unmarked g) root -> step_list g root l -> let marked' := Union _ (marked g) (eq root) in let PV1 := reachable_by_through_set g l (Complement _ marked') in (predicate_partialgraph g (Complement _ (Union _ PV1 (eq root)))) ~=~ (predicate_partialgraph g1 (Complement _ (Union _ PV1 (eq root)))) /\ Same_set (marked g1) (Union _ marked' PV1) -> mark root g g1.
proof: Proof. intros. destruct H2. assert (Same_set (reachable_by g root (unmarked g)) (Union _ (eq root) PV1)). 1: { rewrite Same_set_spec. intro. rewrite Union_spec. unfold PV1, marked'. rewrite <- Intersection_Complement. apply reachable_by_ind_equiv; auto. } split. + eapply si_stronger_partialgraph_simple; [| exact H2]. apply Complement_Included_rev. rewrite H4. rewrite Union_comm. apply Included_refl. + intros. rewrite Same_set_spec in H3; rewrite (H3 n). rewrite Same_set_spec in H4; rewrite (H4 n). unfold marked'. rewrite !Union_spec. tauto. Qed.
imports: Coq.Logic.ProofIrrelevance Coq.Classes.Morphisms VST.msl.Coqlib2 CertiGraph.lib.Coqlib CertiGraph.lib.EquivDec_ext CertiGraph.lib.Relation_ext CertiGraph.lib.relation_list CertiGraph.lib.EnumEnsembles CertiGraph.lib.List_ext CertiGraph.graph.graph_model CertiGraph.graph.path_lemmas CertiGraph.graph.reachable_computable CertiGraph.graph.reachable_ind CertiGraph.graph.graph_gen CertiGraph.graph.subgraph2 CertiGraph.graph.dual_graph