Fin n forms a bounded linear order #
This file contains the linear ordered instance on Fin n.
Fin n is the type whose elements are natural numbers smaller than n.
This file expands on the development in the core library.
Main definitions #
Fin.orderIsoSubtype: coercion to{i // i < n}as anOrderIso;Fin.valEmbedding: coercion to natural numbers as anEmbedding;Fin.valOrderEmb: coercion to natural numbers as anOrderEmbedding;Fin.succOrderEmb:Fin.succas anOrderEmbedding;Fin.castLEOrderEmb h:Fin.castLEas anOrderEmbedding, embedFin nintoFin mwhenh : n ≤ m;Fin.castOrderIso:Fin.castas anOrderIso, order isomorphism betweenFin nandFin mprovided thatn = m, see alsoEquiv.finCongr;Fin.castAddOrderEmb m:Fin.castAddas anOrderEmbedding, embedFin nintoFin (n+m);Fin.castSuccOrderEmb:Fin.castSuccas anOrderEmbedding, embedFin nintoFin (n+1);Fin.addNatOrderEmb m i:Fin.addNatas anOrderEmbedding, addmonion the right, generalizesFin.succ;Fin.natAddOrderEmb n i:Fin.natAddas anOrderEmbedding, addsnonion the left;Fin.revOrderIso:Fin.revas anOrderIso, the antitone involution given byi ↦ n-(i+1)
Instances #
Alias of Fin.coe_max.
Alias of Fin.coe_min.
Extra instances to short-circuit type class resolution #
These also prevent non-computable instances being used to construct these instances non-computably.
Miscellaneous lemmas #
Monotonicity #
Alias of the reverse direction of Fin.natAdd_le_natAdd_iff.
Alias of the reverse direction of Fin.natAdd_lt_natAdd_iff.
Alias of the reverse direction of Fin.addNat_le_addNat_iff.
Alias of the reverse direction of Fin.addNat_lt_addNat_iff.
Alias of the reverse direction of Fin.castLE_le_castLE_iff.
Alias of the reverse direction of Fin.castLE_lt_castLE_iff.
Order isomorphisms #
While in many cases Fin.castOrderIso is better than Equiv.cast/cast, sometimes we want to
apply a generic lemma about cast.
Order embeddings #
The ordering on Fin n is a well order.
Fin.castLE as an OrderEmbedding.
castLEEmb h i embeds i into a larger Fin type.
Equations
Instances For
Fin.castAdd as an OrderEmbedding.
castAddEmb m i embeds i : Fin n in Fin (n+m). See also Fin.natAddEmb and Fin.addNatEmb.
Equations
Instances For
Fin.castSucc as an OrderEmbedding.
castSuccOrderEmb i embeds i : Fin n in Fin (n+1).
Equations
Instances For
Fin.addNat as an OrderEmbedding.
addNatOrderEmb m i adds m to i, generalizes Fin.succ.