proposition: Lemma last_err_appcons: forall {A:Type} (l: list A) (a: A), last_error (l+::a) = Some a.
proof: Proof. induction l. auto. intros. rewrite <- app_comm_cons. rewrite <- (IHl a0). simpl. destruct (l+::a0) eqn:H. assert (l+::a0 <> nil) by (apply app_not_nil). contradiction. reflexivity. 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