Created
July 12, 2013 21:20
-
-
Save etosch/5987951 to your computer and use it in GitHub Desktop.
From the list chapter in the Coq book.
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
(* There is a short solution to the next exercise. | |
If you find yourself getting tangled up, step back and try to look for a simpler way. *) | |
Theorem app_ass4 : forall l1 l2 l3 l4 : natlist, | |
l1 ++ (l2 ++ (l3 ++ l4)) = ((l1 ++ l2) ++ l3) ++ l4. | |
Proof. | |
intros l1 l2 l3 l4. | |
Theorem app_right : forall l1 l2 l3 : natlist, | |
l1 ++ (l2 ++ l3) = (l1 ++ l2) ++ l3. | |
Proof. | |
intros l1 l2 l3. | |
induction l1 as [|h1 t1]. reflexivity. | |
simpl. rewrite -> IHt1. reflexivity. | |
Qed. | |
rewrite <- app_right. rewrite app_right. reflexivity. | |
Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment