Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Require Import Coq.Arith.Arith.
  2. Require Import Coq.Lists.List.
  3. Import ListNotations.
  4.  
  5. Lemma forw_rev_list_ind {A}
  6. (P : list A -> Prop)
  7. (Pnil : P [])
  8. (Psingle : (forall a, P [a]))
  9. (Pmore : (forall a b, forall xs, P xs -> P ([a] ++ xs ++ [b])))
  10. (xs : list A)
  11. : P xs.
  12. Proof.
  13. induction xs as [xs IHxs] using (induction_ltof1 _ (@length _)); unfold ltof in IHxs.
  14. destruct xs as [|x xs _] using rev_ind; [|destruct xs].
  15. - exact Pnil.
  16. - apply Psingle.
  17. - apply Pmore, IHxs.
  18. rewrite app_length; auto with arith.
  19. Qed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement