proposition: Lemma lgd_f2v_eq_after_update: forall tag g v v' e n j, 0 <= n < Zlength (make_fields g v) -> 0 <= j < Zlength (make_fields g v) -> Znth n (make_fields g v) = inr e -> Znth j (upd_Znth n (map (field2val tag g) (make_fields g v)) (vertex_address g v')) = Znth j (map (field2val tag (labeledgraph_gen_dst g e v')) (make_fields (labeledgraph_gen_dst g e v') v)).
proof: Proof. intros. rewrite Znth_map. 2: rewrite lgd_make_fields_eq; assumption. assert (j = n \/ j <> n) by lia; destruct H2. + subst j; rewrite upd_Znth_same. 2: rewrite Zlength_map; assumption. replace (make_fields (labeledgraph_gen_dst g e v') v) with (make_fields g v) by reflexivity. rewrite H1; simpl field2val. unfold updateEdgeFunc; if_tac; try reflexivity. unfold complement in H2; assert (e = e) by reflexivity. apply H2 in H3; exfalso; assumption. + rewrite upd_Znth_diff_strong; [|rewrite Zlength_map|]; try assumption. rewrite Znth_map by assumption. apply (lgd_f2v_eq_except_one _ g (Znth j (make_fields g v))). intro. pose proof (make_fields_edge_unique g e v v n j H H0 H1 H3). lia. Qed.
imports: Coq.ZArith.ZArith Coq.Program.Basics Coq.micromega.Lia compcert.lib.Integers compcert.common.Values VST.veric.base VST.veric.Clight_lemmas VST.veric.val_lemmas VST.veric.shares VST.msl.seplog VST.msl.shares VST.zlist.sublist VST.floyd.coqlib3 VST.floyd.functional_base VST.floyd.data_at_rec_lemmas VST.zlist.list_solver CertiGraph.lib.EquivDec_ext CertiGraph.lib.List_ext CertiGraph.graph.graph_model CertiGraph.graph.graph_gen