proposition: Lemma last_err_app': forall {A:Type} (l2 l1: list A) (a: A), last_error l2 = Some a -> last_error (l1++l2) = Some a.
proof: Proof. induction l2; intros. inversion H. destruct l2. simpl in H. inversion H. apply last_err_appcons. assert (last_error (a::a1::l2) = last_error (a1::l2)). simpl. reflexivity. rewrite H0 in H. assert (l1++a::a1::l2 = (l1+::a) ++ (a1::l2)). assert (a:: a1 :: l2 = (a::nil)++a1::l2) by reflexivity. rewrite H1. rewrite app_assoc. reflexivity. rewrite H1. apply (IHl2 (l1+::a)). apply H. Qed.
imports: Coq.Lists.List Coq.micromega.Lia Coq.Sorting.Permutation Coq.ZArith.ZArith_base Coq.ZArith.Zcomplements Coq.Logic.FunctionalExtensionality CertiGraph.lib.Coqlib CertiGraph.lib.EquivDec_ext VST.zlist.sublist VST.zlist.list_solver