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.

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.