Created
March 23, 2011 16:28
-
-
Save ikedaisuke/883394 to your computer and use it in GitHub Desktop.
reverse (reverse xs) ≡ xs in Coq
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
Require Import Coq.Lists.List. | |
Lemma rev_Unfold : forall {A:Type} (l:list A) (a:A), rev (a::l) = rev l ++ (cons a nil). | |
Proof. | |
intros. | |
simpl. | |
reflexivity. | |
Qed. | |
Theorem rev_Involutive : forall {A:Type} (l:list A), rev (rev l) = l. | |
Proof. | |
intros. | |
induction l. | |
reflexivity. | |
rename IHl into InductiveHypothesisOfl. | |
rewrite rev_Unfold. | |
rewrite rev_app_distr. | |
simpl. | |
rewrite InductiveHypothesisOfl. | |
reflexivity. | |
Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment