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 an- OrderIso;
- Fin.valEmbedding: coercion to natural numbers as an- Embedding;
- Fin.valOrderEmb: coercion to natural numbers as an- OrderEmbedding;
- Fin.succOrderEmb:- Fin.succas an- OrderEmbedding;
- Fin.castLEOrderEmb h:- Fin.castLEas an- OrderEmbedding, embed- Fin ninto- Fin mwhen- h : n ≤ m;
- Fin.castOrderIso:- Fin.castas an- OrderIso, order isomorphism between- Fin nand- Fin mprovided that- n = m, see also- Equiv.finCongr;
- Fin.castAddOrderEmb m:- Fin.castAddas an- OrderEmbedding, embed- Fin ninto- Fin (n+m);
- Fin.castSuccOrderEmb:- Fin.castSuccas an- OrderEmbedding, embed- Fin ninto- Fin (n+1);
- Fin.addNatOrderEmb m i:- Fin.addNatas an- OrderEmbedding, add- mon- ion the right, generalizes- Fin.succ;
- Fin.natAddOrderEmb n i:- Fin.natAddas an- OrderEmbedding, adds- non- ion the left;
- Fin.revOrderIso:- Fin.revas an- OrderIso, the antitone involution given by- i ↦ n-(i+1)
Instances #
Alias of Fin.coe_max.
Alias of Fin.coe_min.
Equations
- Fin.instLinearOrder = Function.Injective.linearOrder Fin.val ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- Fin.instBoundedOrder = { top := Fin.rev 0, le_top := ⋯, bot := 0, bot_le := ⋯ }
Equations
Extra instances to short-circuit type class resolution #
These also prevent non-computable instances being used to construct these instances non-computably.
Equations
Equations
Equations
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.
Fin.predAbove p as an OrderHom.
Equations
- p.predAboveOrderHom = { toFun := p.predAbove, monotone' := ⋯ }
Instances For
predAbove is injective at the pivot
Order isomorphisms #
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.
Equations
- Fin.revOrderIso = { toEquiv := OrderDual.ofDual.trans Fin.revPerm, map_rel_iff' := ⋯ }
Instances For
Order embeddings #
The inclusion map Fin n → ℕ is an order embedding.
Equations
- Fin.valOrderEmb n = { toEmbedding := Fin.valEmbedding, map_rel_iff' := ⋯ }
Instances For
Equations
- Fin.OrderEmbedding.instInhabitedOrderEmbeddingNat = { default := Fin.valOrderEmb n }
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.addNat as an OrderEmbedding.
addNatOrderEmb m i adds m to i, generalizes Fin.succ.
Equations
- Fin.addNatOrderEmb m = OrderEmbedding.ofStrictMono (fun (x : Fin n) => x.addNat m) ⋯