proposition: Lemma last_app : forall a (l1 l2: list A), last (l1 ++ a :: l2) = last (a :: l2).
proof: Proof. induction l1; trivial. intro. replace (last ((a0 :: l1) ++ a::l2)) with (last (l1 ++ a::l2)). rewrite (IHl1 l2); trivial. cut (l1 ++ a::l2 <> nil). simpl; destruct (l1 ++ a::l2); fo. auto with datatypes. Qed.
imports: Coq(Permutation Setoid) CoLoR(NatUtil LogicUtil)