Inductive type variant of Fin #
Fin is defined as a subtype of ℕ. This file defines an equivalent type, Fin2, which is
defined inductively. This is useful for its induction principle and different definitional
equalities.
Main declarations #
Fin2 n: Inductive type variant ofFin n.fzcorresponds to0andfs ncorresponds ton.Fin2.toNat,Fin2.optOfNat,Fin2.ofNat': Conversions to and fromℕ.ofNat' mtakes a proof thatm < nthrough the classFin2.IsLT.Fin2.add k: Takesi : Fin2 ntoi + k : Fin2 (n + k).Fin2.left: EmbedsFin2 nintoFin2 (n + k).Fin2.insertPerm a: Permutation ofFin2 nwhich cycles0, ..., a - 1and leavesa, ..., n - 1unchanged.Fin2.remapLeft f: FunctionFin2 (m + k) → Fin2 (n + k)by applyingf : Fin m → Fin nto0, ..., m - 1and sendingm + iton + i.
insertPerm a is a permutation of Fin2 n with the following properties:
insertPerm a i = i+1ifi < ainsertPerm a a = 0insertPerm a i = iifi > a