(** `fin n` corresponds to "naturals less than `n`",
 ** i.e. a finite set of size n
 **)
Inductive fin : nat -> Type :=
| F0 : forall {n}, fin (S n)
| FS : forall {n}, fin n -> fin (S n).(** `fin n` corresponds to "naturals less than `n`",
 ** i.e. a finite set of size n
 **)
Inductive fin : nat -> Type :=
| F0 : forall {n}, fin (S n)
| FS : forall {n}, fin n -> fin (S n).(** `fin n` corresponds to "naturals less than `n`",
 ** i.e. a finite set of size n
 **)
Inductive fin : nat -> Type :=
| F0 : forall {n}, fin (S n)
| FS : forall {n}, fin n -> fin (S n).Fixpoint fin_all (n : nat) : list (fin n) :=
  match n as n return list (fin n) with
    | 0 => nil
    | S n => @F0 n :: List.map (@FS _) (fin_all n)
  end%list.

(* Specifications: *)
Theorem fin_all_In : forall {n} (f : fin n), List.In f (fin_all n).
Theorem fin_case : forall n (f : fin (S n)), f = F0 \/ exists f', f = FS f'.