Skip to content

Instantly share code, notes, and snippets.

@einblicker
Created February 1, 2012 01:58
Show Gist options
  • Save einblicker/1714506 to your computer and use it in GitHub Desktop.
Save einblicker/1714506 to your computer and use it in GitHub Desktop.
sf chap2
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