Advertisement
Guest User

Untitled

a guest
May 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Require Import List.
  2.  
  3. Set Implicit Arguments.
  4.  
  5. Inductive even_length {A : Type} : list A -> Prop:=
  6. | e_nil : even_length nil
  7. | e_cons : forall e l, odd_length l -> even_length (e::l)
  8. with
  9. odd_length {A : Type} : list A -> Prop :=
  10. | o_cons : forall e l, even_length l -> odd_length (e::l).
  11.  
  12. Lemma map_even : forall A B (f : A -> B) (l : list A),
  13. even_length l -> even_length (map f l).
  14. Proof.
  15. induction l.
  16. (** nil *)
  17. - intros. simpl. econstructor.
  18. (** cons *)
  19. - intros. simpl.
  20. inversion_clear H.
  21. econstructor.
  22. Abort. (** odd_length l -> odd_length (map f l) would help *)
  23.  
  24. Scheme even_length_mut := Induction for even_length Sort Prop
  25. with odd_length_mut := Induction for odd_length Sort Prop.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement