Created
January 11, 2015 10:17
-
-
Save mbrcknl/51606927317caf2bec79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lemma list_len_odd_even_ind: | |
forall | |
(X: Type) | |
(P: list X -> Prop) | |
(H: forall xs, length xs = 0 -> P xs) | |
(J: forall xs, length xs = 1 -> P xs) | |
(K: forall xs n, length xs = n -> P xs -> forall ys, length ys = S (S n) -> P ys) | |
(l: list X), | |
P l. | |
Proof. | |
intros. cut (P l /\ forall y, P (y :: l)). tauto. | |
induction l. | |
split; [ apply (H []) | intro y; apply (J [y]) ]; reflexivity. | |
destruct IHl as [L R]. | |
split. | |
apply (R x). | |
intros; apply (K l (length l) refl_equal L); reflexivity. | |
Qed. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment