# Documentation

Mathlib.Data.Fintype.Sort

# Sorting a finite type #

This file provides two equivalences for linearly ordered fintypes:

• monoEquivOfFin: Order isomorphism between α and Fin (card α).
• finSumEquivOfFinset: Equivalence between α and Fin m ⊕ Fin n where m and n are respectively the cardinalities of some Finset α and its complement.
def monoEquivOfFin (α : Type u_1) [inst : ] [inst : ] {k : } (h : ) :
Fin k ≃o α

Given a linearly ordered fintype α of cardinal k, the order isomorphism monoEquivOfFin α h is the increasing bijection between Fin k and α. Here, h is a proof that the cardinality of α is k. We use this instead of an isomorphism Fin (card α) ≃o α to avoid casting issues in further uses of this function.

Equations
def finSumEquivOfFinset {α : Type u_1} [inst : ] [inst : ] [inst : ] {m : } {n : } {s : } (hm : = m) (hn : Finset.card (s) = n) :
Fin m Fin n α

If α is a linearly ordered fintype, s : Finset α has cardinality m and its complement has cardinality n, then Fin m ⊕ Fin n ≃ α. The equivalence sends elements of Fin mto elements ofsand elements ofFin nto elements ofsᶜwhile preserving order on each "half" ofFin m ⊕ Fin n(usingSet.orderIsoOfFin`).

Equations
• One or more equations did not get rendered due to their size.
@[simp]
theorem finSumEquivOfFinset_inl {α : Type u_1} [inst : ] [inst : ] [inst : ] {m : } {n : } {s : } (hm : = m) (hn : Finset.card (s) = n) (i : Fin m) :
↑() () = ().toEmbedding i
@[simp]
theorem finSumEquivOfFinset_inr {α : Type u_1} [inst : ] [inst : ] [inst : ] {m : } {n : } {s : } (hm : = m) (hn : Finset.card (s) = n) (i : Fin n) :
↑() () = ().toEmbedding i