proposition: Lemma gsepl_DoubleNoDup: forall (v1 v2 : VType) (g : LGraph), v1 <> v2 -> DoubleNoDup (gen_single_edge_pair_list g (v1, v2)).
proof: Proof. intros. simpl. pose proof (get_edges_NoDup g v1). remember (get_edges g v1). assert (forall e, In e l -> fst e = v1) by (intros; subst l; apply get_edges_fst in H1; assumption). clear Heql g. induction l; simpl; [constructor|]. rewrite DoubleNoDup_cons_iff. destruct a as [? idx]. simpl. assert (v = v1) by (change v with (fst (v, idx)); apply H1; left; reflexivity). subst v. split; [|split; [|split]]. - apply IHl. 1: apply NoDup_cons_1 in H0; assumption. intros. apply H1. simpl. now right. - intro. inversion H2. contradiction. - unfold InEither. rewrite combine_split by (rewrite map_length; reflexivity). intro. rewrite in_app_iff in H2. destruct H2. + apply NoDup_cons_2 in H0. contradiction. + rewrite in_map_iff in H2. destruct H2 as [x [? ?]]. inversion H2. auto. - unfold InEither. rewrite combine_split by (rewrite map_length; reflexivity). intro. rewrite in_app_iff in H2. destruct H2. + specialize (H1 (v2, idx)). simpl in H1. apply H; now rewrite H1; [|right]. + rewrite in_map_iff in H2. destruct H2 as [[? ?] [? ?]]. simpl in *. inversion H2. subst n. clear H2. assert (v = v1) by (change v with (fst (v, idx)); apply H1; right; assumption). subst. apply NoDup_cons_2 in H0. contradiction. Qed.
imports: Coq.ZArith.ZArith Coq.Program.Basics 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 CertiGraph.lib.Coqlib CertiGraph.lib.EquivDec_ext CertiGraph.lib.List_ext CertiGraph.graph.graph_model CertiGraph.graph.graph_gen CertiGraph.graph.path_lemmas CertiGraph.graph.subgraph2 CertiGraph.graph.graph_relation CertiGraph.graph.graph_isomorphism CertiGraph.graph.reachable_ind CertiGraph.CertiGC.GCGraph