# Documentation

Mathlib.Data.Fintype.Order

# Order structures on finite types #

This file provides order instances on fintypes.

## Computable instances #

On a Fintype, we can construct

• an OrderBot from SemilatticeInf.
• an OrderTop from SemilatticeSup.
• a BoundedOrder from Lattice.

Those are marked as def to avoid defeqness issues.

## Completion instances #

Those instances are noncomputable because the definitions of sSup and sInf use Set.toFinset and set membership is undecidable in general.

On a Fintype, we can promote:

• a Lattice to a CompleteLattice.
• a DistribLattice to a CompleteDistribLattice.
• a LinearOrder to a CompleteLinearOrder.
• a BooleanAlgebra to a CompleteAtomicBooleanAlgebra.

Those are marked as def to avoid typeclass loops.

## Concrete instances #

We provide a few instances for concrete types:

• Fin.completeLinearOrder
• Bool.completeLinearOrder
• Bool.completeBooleanAlgebra
@[reducible]
def Fintype.toOrderBot (α : Type u_2) [] [] [] :

Constructs the ⊥ of a finite nonempty SemilatticeInf.

Instances For
@[reducible]
def Fintype.toOrderTop (α : Type u_2) [] [] [] :

Constructs the ⊤ of a finite nonempty SemilatticeSup

Instances For
@[reducible]
def Fintype.toBoundedOrder (α : Type u_2) [] [] [] :

Constructs the ⊤ and ⊥ of a finite nonempty Lattice.

Instances For
@[reducible]
noncomputable def Fintype.toCompleteLattice (α : Type u_2) [] [] [] :

A finite bounded lattice is complete.

Instances For
@[reducible]
noncomputable def Fintype.toCompleteDistribLattice (α : Type u_2) [] [] [] :

A finite bounded distributive lattice is completely distributive.

Instances For
@[reducible]
noncomputable def Fintype.toCompleteLinearOrder (α : Type u_2) [] [] [] :

A finite bounded linear order is complete.

Instances For
@[reducible]
noncomputable def Fintype.toCompleteBooleanAlgebra (α : Type u_2) [] [] :

A finite boolean algebra is complete.

Instances For
@[reducible]
noncomputable def Fintype.toCompleteAtomicBooleanAlgebra (α : Type u_2) [] [] :

A finite boolean algebra is complete and atomic.

Instances For
@[reducible]
noncomputable def Fintype.toCompleteLatticeOfNonempty (α : Type u_2) [] [] [] :

A nonempty finite lattice is complete. If the lattice is already a BoundedOrder, then use Fintype.toCompleteLattice instead, as this gives definitional equality for ⊥ and ⊤.

Instances For
@[reducible]
noncomputable def Fintype.toCompleteLinearOrderOfNonempty (α : Type u_2) [] [] [] :

A nonempty finite linear order is complete. If the linear order is already a BoundedOrder, then use Fintype.toCompleteLinearOrder instead, as this gives definitional equality for ⊥ and ⊤.

Instances For

### Concrete instances #

noncomputable instance Fin.completeLinearOrder {n : } :
noncomputable instance Bool.completeLinearOrder :
noncomputable instance Bool.completeBooleanAlgebra :

### Directed Orders #

theorem Directed.fintype_le {α : Type u_1} {r : ααProp} [IsTrans α r] {β : Type u_2} {γ : Type u_3} [] {f : γα} [] (D : Directed r f) (g : βγ) :
z, (i : β) → r (f (g i)) (f z)
theorem Fintype.exists_le {α : Type u_1} [] [] [IsDirected α fun x x_1 => x x_1] {β : Type u_2} [] (f : βα) :
M, ∀ (i : β), f i M
theorem Fintype.exists_ge {α : Type u_1} [] [] [IsDirected α fun x x_1 => x x_1] {β : Type u_2} [] (f : βα) :
M, ∀ (i : β), M f i
theorem Fintype.bddAbove_range {α : Type u_1} [] [] [IsDirected α fun x x_1 => x x_1] {β : Type u_2} [] (f : βα) :
theorem Fintype.bddBelow_range {α : Type u_1} [] [] [IsDirected α fun x x_1 => x x_1] {β : Type u_2} [] (f : βα) :