Fixpoint from_fin_mult {m n} : Fin (m * n) -> Fin m * Fin n :=
match m with
| 0 => fun i =>
match i with
end
| S k => fun i =>
match from_fin_sum i with
| inl j => (inl tt, j)
| inr j =>
match from_fin_mult j with
| (k1, k2) => (inr k1, k2)
end
end
end.

(* Specifications: *)
Lemma to_from_fin_mult {m n} : forall i : Fin (m * n), to_fin_mult (from_fin_mult i) = i.
Lemma from_to_fin_mult {m n} : forall p : Fin m * Fin n, from_fin_mult (to_fin_mult p) = p.
Fixpoint Fin_enum n : list (Fin n) :=
match n with
| 0 => []
| S m => inl tt :: map inr (Fin_enum m)
end.
Lemma Fin_enum_correct (n : nat) : forall i, In i (Fin_enum n).
Lemma Fin_enum_length n : length (Fin_enum n) = n.
End FinStuff.