Inductive natprod : Type :=
| pair : nat -> nat -> natprod.Inductive natprod : Type :=
| pair : nat -> nat -> natprod.Instance dec_natprod (p q : natprod) : Dec (p = q).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.Notation "x ++ y" := (app x y)
                     (right associativity, at level 60).Definition fst' (p : natprod) : nat :=
  match p with
  | (x,y) => x
  end.Definition snd' (p : natprod) : nat :=
  match p with
  | (x,y) => y
  end.Definition swap_pair (p : natprod) : natprod :=
  match p with
  | (x,y) => (y,x)
  end.

Theorem fst_swap_is_snd : forall (p : natprod), fst (swap_pair p) = snd p.