Created
February 1, 2012 01:58
-
-
Save einblicker/1714506 to your computer and use it in GitHub Desktop.
sf chap2
This file contains hidden or 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
Section List_J. | |
Module NatList. | |
Inductive natprod : Type := | |
pair : nat -> nat -> natprod. | |
Definition fst (p : natprod) : nat := | |
match p with | |
| pair x y => x | |
end. | |
Definition snd (p : natprod) : nat := | |
match p with | |
| pair x y => y | |
end. | |
Definition swap_pair (p : natprod) : natprod := | |
match p with | |
| (x,y) => (y,x) | |
end. | |
Notation "( x , y )" := (pair x y). | |
Theorem snd_fst_is_swap : forall (p : natprod), | |
(snd p, fst p) = swap_pair p. | |
Proof. | |
intros. | |
destruct p. | |
reflexivity. | |
Qed. | |
End NatList. | |
End List_J. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment