Fixpoint fin (n : nat) : Type :=
  match n with
    | 0 => False
    | S n' => option (fin n')
  end.Fixpoint fin_eq_dec (n : nat) : forall (a b : fin n), {a = b} + {a <> b}.Fixpoint all_fin (n : nat) : list (fin n) :=
  match n with
    | 0 => []
    | S n' => None :: map (fun x => Some x) (all_fin n')
  end.

(* Specifications: *)
Lemma all_fin_all : forall n (x : fin n), In x (all_fin n).
Lemma all_fin_NoDup : forall n, NoDup (all_fin n).