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

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:

Those are marked as def to avoid typeclass loops.

Concrete instances #

We provide a few instances for concrete types:

@[reducible, inline]
abbrev Fintype.toOrderBot (α : Type u_2) [Fintype α] [Nonempty α] [SemilatticeInf α] :

Constructs the of a finite nonempty SemilatticeInf.

Equations
Instances For
    @[reducible, inline]
    abbrev Fintype.toOrderTop (α : Type u_2) [Fintype α] [Nonempty α] [SemilatticeSup α] :

    Constructs the of a finite nonempty SemilatticeSup

    Equations
    Instances For
      @[reducible, inline]
      abbrev Fintype.toBoundedOrder (α : Type u_2) [Fintype α] [Nonempty α] [Lattice α] :

      Constructs the and of a finite nonempty Lattice.

      Equations
      Instances For
        @[reducible, inline]
        noncomputable abbrev Fintype.toCompleteLattice (α : Type u_2) [Fintype α] [Lattice α] [BoundedOrder α] :

        A finite bounded lattice is complete.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[reducible, inline]

          A finite bounded distributive lattice is completely distributive.

          Equations
          Instances For
            @[reducible, inline]

            A finite bounded distributive lattice is completely distributive.

            Equations
            Instances For
              @[reducible, inline]
              noncomputable abbrev Fintype.toCompleteLinearOrder (α : Type u_2) [Fintype α] [LinearOrder α] [BoundedOrder α] :

              A finite bounded linear order is complete.

              If the α is already a BiheytingAlgebra, then prefer to construct this instance manually using Fintype.toCompleteLattice instead, to avoid creating a diamond with LinearOrder.toBiheytingAlgebra.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[reducible, inline]

                A finite Boolean algebra is complete.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[reducible, inline]

                  A finite Boolean algebra is complete and atomic.

                  Equations
                  Instances For
                    @[reducible, inline]
                    noncomputable abbrev Fintype.toCompleteLatticeOfNonempty (α : Type u_2) [Fintype α] [Nonempty α] [Lattice α] :

                    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 .

                    Equations
                    Instances For
                      @[reducible, inline]

                      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 .

                      Equations
                      Instances For

                        Concrete instances #

                        @[implicit_reducible]
                        noncomputable instance Fin.completeLinearOrder {n : } [NeZero n] :
                        Equations
                        @[implicit_reducible]
                        Equations
                        • One or more equations did not get rendered due to their size.

                        Directed Orders #

                        theorem Directed.finite_set_le {α : Type u_1} {r : ααProp} [IsTrans α r] {γ : Type u_3} [Nonempty γ] {f : γα} (D : Directed r f) {s : Set γ} (hs : s.Finite) :
                        ∃ (z : γ), is, r (f i) (f z)
                        theorem Directed.finite_le {α : Type u_1} {r : ααProp} [IsTrans α r] {β : Type u_2} {γ : Type u_3} [Nonempty γ] {f : γα} [Finite β] (D : Directed r f) (g : βγ) :
                        ∃ (z : γ), ∀ (i : β), r (f (g i)) (f z)
                        theorem Finite.exists_le {α : Type u_1} {β : Type u_2} [Finite β] [Nonempty α] [Preorder α] [IsDirectedOrder α] (f : βα) :
                        ∃ (M : α), ∀ (i : β), f i M
                        theorem Finite.exists_ge {α : Type u_1} {β : Type u_2} [Finite β] [Nonempty α] [Preorder α] [IsCodirectedOrder α] (f : βα) :
                        ∃ (M : α), ∀ (i : β), M f i
                        theorem Set.Finite.exists_le {α : Type u_1} [Nonempty α] [Preorder α] [IsDirectedOrder α] {s : Set α} (hs : s.Finite) :
                        ∃ (M : α), is, i M
                        theorem Set.Finite.exists_ge {α : Type u_1} [Nonempty α] [Preorder α] [IsCodirectedOrder α] {s : Set α} (hs : s.Finite) :
                        ∃ (M : α), is, M i
                        @[simp]
                        theorem Finite.bddAbove_range {α : Type u_1} {β : Type u_2} [Finite β] [Nonempty α] [Preorder α] [IsDirectedOrder α] (f : βα) :
                        @[simp]
                        theorem Finite.bddBelow_range {α : Type u_1} {β : Type u_2} [Finite β] [Nonempty α] [Preorder α] [IsCodirectedOrder α] (f : βα) :

                        Suprema and infima over finite types #

                        We state simplified versions of le_ciSup_if_le and ciSup_mono when the indexing type is finite. This avoids having to explicitly use Finite.bddAbove_range.

                        Similarly for ciInf.

                        theorem Finite.le_ciSup_of_le {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] {a : α} {f : ια} (c : ι) (h : a f c) :
                        a iSup f
                        theorem Finite.ciInf_le_of_le {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] {a : α} {f : ια} (c : ι) (h : f c a) :
                        iInf f a
                        theorem Finite.ciSup_mono {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] {f g : ια} (H : ∀ (x : ι), f x g x) :
                        theorem Finite.ciInf_mono {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] {f g : ια} (H : ∀ (x : ι), f x g x) :
                        theorem Finite.le_ciSup {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] (f : ια) (i : ι) :
                        f i ⨆ (j : ι), f j
                        theorem Finite.ciInf_le {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] (f : ια) (i : ι) :
                        ⨅ (j : ι), f j f i
                        theorem Finite.ciSup_sup {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] [Nonempty ι] {f : ια} {a : α} :
                        (⨆ (i : ι), f i)a = ⨆ (i : ι), f ia
                        theorem Finite.ciInf_inf {α : Type u_1} {ι : Type u_2} [Finite ι] [ConditionallyCompleteLattice α] [Nonempty ι] {f : ια} {a : α} :
                        (⨅ (i : ι), f i)a = ⨅ (i : ι), f ia
                        theorem Finite.ciSup_prod {α : Type u_1} {ι : Type u_2} {ι' : Type u_3} [Finite ι] [Finite ι'] [ConditionallyCompleteLattice α] (f : ι × ι'α) :
                        ⨆ (a : ι × ι'), f a = ⨆ (i : ι), ⨆ (i' : ι'), f (i, i')
                        theorem Finite.ciInf_prod {α : Type u_1} {ι : Type u_2} {ι' : Type u_3} [Finite ι] [Finite ι'] [ConditionallyCompleteLattice α] (f : ι × ι'α) :
                        ⨅ (a : ι × ι'), f a = ⨅ (i : ι), ⨅ (i' : ι'), f (i, i')
                        theorem Finite.map_iSup_of_monotoneOn {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] {s : Set α} {f : ια} {g : αβ} (hg : MonotoneOn g s) (hs : ∀ (i : ι), f i s) :
                        g (⨆ (i : ι), f i) = ⨆ (i : ι), g (f i)
                        theorem Finite.map_iInf_of_monotoneOn {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] {s : Set α} {f : ια} {g : αβ} (hg : MonotoneOn g s) (hs : ∀ (i : ι), f i s) :
                        g (⨅ (i : ι), f i) = ⨅ (i : ι), g (f i)
                        theorem Finite.map_iSup_of_antitoneOn {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] {s : Set α} {f : ια} {g : αβ} (hg : AntitoneOn g s) (hs : ∀ (i : ι), f i s) :
                        g (⨆ (i : ι), f i) = ⨅ (i : ι), g (f i)
                        theorem Finite.map_iInf_of_antitoneOn {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] {s : Set α} {f : ια} {g : αβ} (hg : AntitoneOn g s) (hs : ∀ (i : ι), f i s) :
                        g (⨅ (i : ι), f i) = ⨆ (i : ι), g (f i)
                        theorem Finite.map_iSup_of_monotone {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] (f : ια) {g : αβ} (hg : Monotone g) :
                        g (⨆ (i : ι), f i) = ⨆ (i : ι), g (f i)
                        theorem Finite.map_iInf_of_monotone {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] (f : ια) {g : αβ} (hg : Monotone g) :
                        g (⨅ (i : ι), f i) = ⨅ (i : ι), g (f i)
                        theorem Finite.map_iSup_of_antitone {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] (f : ια) {g : αβ} (hg : Antitone g) :
                        g (⨆ (i : ι), f i) = ⨅ (i : ι), g (f i)
                        theorem Finite.map_iInf_of_antitone {α : Type u_1} {β : Type u_2} {ι : Type u_3} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrder β] [Finite ι] [Nonempty ι] (f : ια) {g : αβ} (hg : Antitone g) :
                        g (⨅ (i : ι), f i) = ⨆ (i : ι), g (f i)