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 #
Extra instances to short-circuit type class resolution #
These also prevent non-computable instances being used to construct these instances non-computably.
Miscellaneous lemmas #
A function f on Fin (n + 1) is strictly monotone if and only if f i < f (i + 1)
for all i.
A function f on Fin (n + 1) is monotone if and only if f i โค f (i + 1) for all i.
A function f on Fin (n + 1) is strictly antitone if and only if f (i + 1) < f i
for all i.
A function f on Fin (n + 1) is antitone if and only if f (i + 1) โค f i for all i.
Monotonicity #
Fin.predAbove p as an OrderHom.
Instances For
predAbove is injective at the pivot
predAbove is injective at the pivot
Order isomorphisms #
The equivalence Fin n โ {i // i < n} is an order isomorphism.
Instances For
While in many cases Fin.castOrderIso is better than Equiv.cast/cast, sometimes we want to
apply a generic lemma about cast.
Fin.rev n as an order-reversing isomorphism.
Instances For
Order embeddings #
The inclusion map Fin n โ โ is an order embedding.
Instances For
The ordering on Fin n is a well order.
Fin.succ as an OrderEmbedding
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.
Instances For
Fin.succAbove p as an OrderEmbedding.
Instances For
Uniqueness of order isomorphisms #
If e is an orderIso between Fin n and Fin m, then n = m and e is the identity
map. In this lemma we state that for each i : Fin n we have (e i : โ) = (i : โ).