The areas / V04. Order and lattices
Mathlib.Order.Std
36 declarations. Mathlib docs · Source
Converting Std order typeclasses into Mathlib ones
This file provides factories for creating Mathlib order typeclasses (PartialOrder, LinearOrder)
from Std ones.
When all instances are present, the factories may be used without arguments:
instance : LinearOrder X := .ofStd X
Otherwise, it may be necessary to provide some instances manually:
instance : LinearOrder X := .ofStd X
{ lawfulOrderOrd := sorry }
When existing instances of typeclasses exist, they will be preferred; otherwise, they will be generated automatically.
Implementation notes
This module's job is to take a bunch of autoparams filled in with all the ways we could synthesize
order typeclasses from Std and bundle them into a Mathlib order typeclass. We also need
inheritance of sets of autoparams, because PartialOrder.ofStd takes all the autoparams of
Preorder.ofStd and then some.
To achieve this, each set of autoparams becomes a structure called OfStdArgs (thereby allowing it
to extend existing OfStdArgs structures), and the synthesization scripts are in the default field
values of this type. For the user, a simple {} will synthesize all fields of the structure with
tactics, while individual fields that fail to synthesize may be specified using { field := … }.
The autoparam tactic scripts prioritize existing instances if they exist, to prevent diamonds,
and in such cases require extra Prop typeclasses to ensure everyone agrees on the order.
Otherwise, those agreement typeclasses can be synthesized with tactics automatically.
Often, we write let := someField in the type of the structure fields, followed by extract_lets
in the tactic body. This is done to make sure that someField is an instance that can be found by
typeclass search in the tactic body: in the case where someField is generated by some means other
than typeclass inference, it does not exist as a local variable otherwise.
def LinearOrder.OfStdArgs.ctorIdx E1 #
{α : Type u_1} → LinearOrder.OfStdArgs α → ℕ
theorem LinearOrder.OfStdArgs.mk.inj E1 #
∀ {α : Type u_1} {toPartialOrderArgs : PartialOrder.OfStdArgs α}
{isLinearOrder :
autoParam
(let this := toPartialOrderArgs.le;
Std.IsLinearOrder α)
LinearOrder.OfStdArgs.isLinearOrder._autoParam}
{decidableLE : autoParam (DecidableLE α) LinearOrder.OfStdArgs.decidableLE._autoParam}
{decidableEq :
autoParam
(let this := toPartialOrderArgs;
let this := decidableLE;
DecidableEq α)
LinearOrder.OfStdArgs.decidableEq._autoParam}
{decidableLT :
autoParam
(let this := toPartialOrderArgs.toPreorderArgs;
let this := decidableLE;
DecidableLT α)
LinearOrder.OfStdArgs.decidableLT._autoParam}
{min :
autoParam
(let this := toPartialOrderArgs.le;
let this := decidableLE;
Min α)
LinearOrder.OfStdArgs.min._autoParam}
{max :
autoParam
(let this := toPartialOrderArgs.le;
let this := decidableLE;
Max α)
LinearOrder.OfStdArgs.max._autoParam}
{lawfulOrderLeftLeaningMin :
autoParam (Std.LawfulOrderLeftLeaningMin α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMin._autoParam}
{lawfulOrderLeftLeaningMax :
autoParam (Std.LawfulOrderLeftLeaningMax α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMax._autoParam}
{ord :
autoParam
(let this := toPartialOrderArgs.lt;
let this := decidableEq;
let this := decidableLT;
Ord α)
LinearOrder.OfStdArgs.ord._autoParam}
{lawfulOrderOrd :
autoParam
(let this := toPartialOrderArgs.le;
let this_1 := toPartialOrderArgs.lt;
let this_2 := ⋯;
let this_3 := isLinearOrder;
let this_4 := decidableEq;
let this_5 := decidableLT;
Std.LawfulOrderOrd α)
LinearOrder.OfStdArgs.lawfulOrderOrd._autoParam}
{toPartialOrderArgs_1 : PartialOrder.OfStdArgs α}
{isLinearOrder_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
Std.IsLinearOrder α)
LinearOrder.OfStdArgs.isLinearOrder._autoParam}
{decidableLE_1 : autoParam (DecidableLE α) LinearOrder.OfStdArgs.decidableLE._autoParam}
{decidableEq_1 :
autoParam
(let this := toPartialOrderArgs_1;
let this := decidableLE_1;
DecidableEq α)
LinearOrder.OfStdArgs.decidableEq._autoParam}
{decidableLT_1 :
autoParam
(let this := toPartialOrderArgs_1.toPreorderArgs;
let this := decidableLE_1;
DecidableLT α)
LinearOrder.OfStdArgs.decidableLT._autoParam}
{min_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
let this := decidableLE_1;
Min α)
LinearOrder.OfStdArgs.min._autoParam}
{max_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
let this := decidableLE_1;
Max α)
LinearOrder.OfStdArgs.max._autoParam}
{lawfulOrderLeftLeaningMin_1 :
autoParam (Std.LawfulOrderLeftLeaningMin α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMin._autoParam}
{lawfulOrderLeftLeaningMax_1 :
autoParam (Std.LawfulOrderLeftLeaningMax α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMax._autoParam}
{ord_1 :
autoParam
(let this := toPartialOrderArgs_1.lt;
let this := decidableEq_1;
let this := decidableLT_1;
Ord α)
LinearOrder.OfStdArgs.ord._autoParam}
{lawfulOrderOrd_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
let this_1 := toPartialOrderArgs_1.lt;
let this_2 := ⋯;
let this_3 := isLinearOrder_1;
let this_4 := decidableEq_1;
let this_5 := decidableLT_1;
Std.LawfulOrderOrd α)
LinearOrder.OfStdArgs.lawfulOrderOrd._autoParam},
{ toPartialOrderArgs := toPartialOrderArgs, isLinearOrder := isLinearOrder, decidableLE := decidableLE,
decidableEq := decidableEq, decidableLT := decidableLT, min := min, max := max,
lawfulOrderLeftLeaningMin := lawfulOrderLeftLeaningMin, lawfulOrderLeftLeaningMax := lawfulOrderLeftLeaningMax,
ord := ord, lawfulOrderOrd := lawfulOrderOrd } =
{ toPartialOrderArgs := toPartialOrderArgs_1, isLinearOrder := isLinearOrder_1, decidableLE := decidableLE_1,
decidableEq := decidableEq_1, decidableLT := decidableLT_1, min := min_1, max := max_1,
lawfulOrderLeftLeaningMin := lawfulOrderLeftLeaningMin_1,
lawfulOrderLeftLeaningMax := lawfulOrderLeftLeaningMax_1, ord := ord_1, lawfulOrderOrd := lawfulOrderOrd_1 } →
toPartialOrderArgs = toPartialOrderArgs_1 ∧
decidableLE ≍ decidableLE_1 ∧
decidableEq = decidableEq_1 ∧ decidableLT ≍ decidableLT_1 ∧ min = min_1 ∧ max = max_1 ∧ ord = ord_1
def PartialOrder.OfStdArgs.ctorIdx E1 #
{α : Type u_1} → PartialOrder.OfStdArgs α → ℕ
theorem Preorder.OfStdArgs.mk.inj E1 #
∀ {α : Type u_1} {le : autoParam (LE α) Preorder.OfStdArgs.le._autoParam}
{lt :
autoParam
(let this := le;
LT α)
Preorder.OfStdArgs.lt._autoParam}
{lawfulOrderLT :
autoParam
(let this := le;
let this_1 := lt;
Std.LawfulOrderLT α)
Preorder.OfStdArgs.lawfulOrderLT._autoParam}
{isPreorder :
autoParam
(let this := le;
Std.IsPreorder α)
Preorder.OfStdArgs.isPreorder._autoParam}
{le_1 : autoParam (LE α) Preorder.OfStdArgs.le._autoParam}
{lt_1 :
autoParam
(let this := le_1;
LT α)
Preorder.OfStdArgs.lt._autoParam}
{lawfulOrderLT_1 :
autoParam
(let this := le_1;
let this_1 := lt_1;
Std.LawfulOrderLT α)
Preorder.OfStdArgs.lawfulOrderLT._autoParam}
{isPreorder_1 :
autoParam
(let this := le_1;
Std.IsPreorder α)
Preorder.OfStdArgs.isPreorder._autoParam},
{ le := le, lt := lt, lawfulOrderLT := lawfulOrderLT, isPreorder := isPreorder } =
{ le := le_1, lt := lt_1, lawfulOrderLT := lawfulOrderLT_1, isPreorder := isPreorder_1 } →
le = le_1 ∧ lt = lt_1
def Preorder.OfStdArgs.ctorIdx E1 #
{α : Type u_1} → Preorder.OfStdArgs α → ℕ
theorem PartialOrder.OfStdArgs.mk.injEq E0 #
∀ {α : Type u_1} (toPreorderArgs : Preorder.OfStdArgs α)
(isPartialOrder :
autoParam
(let this := toPreorderArgs.le;
Std.IsPartialOrder α)
PartialOrder.OfStdArgs.isPartialOrder._autoParam)
(toPreorderArgs_1 : Preorder.OfStdArgs α)
(isPartialOrder_1 :
autoParam
(let this := toPreorderArgs_1.le;
Std.IsPartialOrder α)
PartialOrder.OfStdArgs.isPartialOrder._autoParam),
({ toPreorderArgs := toPreorderArgs, isPartialOrder := isPartialOrder } =
{ toPreorderArgs := toPreorderArgs_1, isPartialOrder := isPartialOrder_1 }) =
(toPreorderArgs = toPreorderArgs_1)
theorem Preorder.OfStdArgs.mk.injEq E0 #
∀ {α : Type u_1} (le : autoParam (LE α) Preorder.OfStdArgs.le._autoParam)
(lt :
autoParam
(let this := le;
LT α)
Preorder.OfStdArgs.lt._autoParam)
(lawfulOrderLT :
autoParam
(let this := le;
let this_1 := lt;
Std.LawfulOrderLT α)
Preorder.OfStdArgs.lawfulOrderLT._autoParam)
(isPreorder :
autoParam
(let this := le;
Std.IsPreorder α)
Preorder.OfStdArgs.isPreorder._autoParam)
(le_1 : autoParam (LE α) Preorder.OfStdArgs.le._autoParam)
(lt_1 :
autoParam
(let this := le_1;
LT α)
Preorder.OfStdArgs.lt._autoParam)
(lawfulOrderLT_1 :
autoParam
(let this := le_1;
let this_1 := lt_1;
Std.LawfulOrderLT α)
Preorder.OfStdArgs.lawfulOrderLT._autoParam)
(isPreorder_1 :
autoParam
(let this := le_1;
Std.IsPreorder α)
Preorder.OfStdArgs.isPreorder._autoParam),
({ le := le, lt := lt, lawfulOrderLT := lawfulOrderLT, isPreorder := isPreorder } =
{ le := le_1, lt := lt_1, lawfulOrderLT := lawfulOrderLT_1, isPreorder := isPreorder_1 }) =
(le = le_1 ∧ lt = lt_1)
theorem LinearOrder.OfStdArgs.mk.injEq E0 #
∀ {α : Type u_1} (toPartialOrderArgs : PartialOrder.OfStdArgs α)
(isLinearOrder :
autoParam
(let this := toPartialOrderArgs.le;
Std.IsLinearOrder α)
LinearOrder.OfStdArgs.isLinearOrder._autoParam)
(decidableLE : autoParam (DecidableLE α) LinearOrder.OfStdArgs.decidableLE._autoParam)
(decidableEq :
autoParam
(let this := toPartialOrderArgs;
let this := decidableLE;
DecidableEq α)
LinearOrder.OfStdArgs.decidableEq._autoParam)
(decidableLT :
autoParam
(let this := toPartialOrderArgs.toPreorderArgs;
let this := decidableLE;
DecidableLT α)
LinearOrder.OfStdArgs.decidableLT._autoParam)
(min :
autoParam
(let this := toPartialOrderArgs.le;
let this := decidableLE;
Min α)
LinearOrder.OfStdArgs.min._autoParam)
(max :
autoParam
(let this := toPartialOrderArgs.le;
let this := decidableLE;
Max α)
LinearOrder.OfStdArgs.max._autoParam)
(lawfulOrderLeftLeaningMin :
autoParam (Std.LawfulOrderLeftLeaningMin α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMin._autoParam)
(lawfulOrderLeftLeaningMax :
autoParam (Std.LawfulOrderLeftLeaningMax α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMax._autoParam)
(ord :
autoParam
(let this := toPartialOrderArgs.lt;
let this := decidableEq;
let this := decidableLT;
Ord α)
LinearOrder.OfStdArgs.ord._autoParam)
(lawfulOrderOrd :
autoParam
(let this := toPartialOrderArgs.le;
let this_1 := toPartialOrderArgs.lt;
let this_2 := ⋯;
let this_3 := isLinearOrder;
let this_4 := decidableEq;
let this_5 := decidableLT;
Std.LawfulOrderOrd α)
LinearOrder.OfStdArgs.lawfulOrderOrd._autoParam)
(toPartialOrderArgs_1 : PartialOrder.OfStdArgs α)
(isLinearOrder_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
Std.IsLinearOrder α)
LinearOrder.OfStdArgs.isLinearOrder._autoParam)
(decidableLE_1 : autoParam (DecidableLE α) LinearOrder.OfStdArgs.decidableLE._autoParam)
(decidableEq_1 :
autoParam
(let this := toPartialOrderArgs_1;
let this := decidableLE_1;
DecidableEq α)
LinearOrder.OfStdArgs.decidableEq._autoParam)
(decidableLT_1 :
autoParam
(let this := toPartialOrderArgs_1.toPreorderArgs;
let this := decidableLE_1;
DecidableLT α)
LinearOrder.OfStdArgs.decidableLT._autoParam)
(min_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
let this := decidableLE_1;
Min α)
LinearOrder.OfStdArgs.min._autoParam)
(max_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
let this := decidableLE_1;
Max α)
LinearOrder.OfStdArgs.max._autoParam)
(lawfulOrderLeftLeaningMin_1 :
autoParam (Std.LawfulOrderLeftLeaningMin α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMin._autoParam)
(lawfulOrderLeftLeaningMax_1 :
autoParam (Std.LawfulOrderLeftLeaningMax α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMax._autoParam)
(ord_1 :
autoParam
(let this := toPartialOrderArgs_1.lt;
let this := decidableEq_1;
let this := decidableLT_1;
Ord α)
LinearOrder.OfStdArgs.ord._autoParam)
(lawfulOrderOrd_1 :
autoParam
(let this := toPartialOrderArgs_1.le;
let this_1 := toPartialOrderArgs_1.lt;
let this_2 := ⋯;
let this_3 := isLinearOrder_1;
let this_4 := decidableEq_1;
let this_5 := decidableLT_1;
Std.LawfulOrderOrd α)
LinearOrder.OfStdArgs.lawfulOrderOrd._autoParam),
({ toPartialOrderArgs := toPartialOrderArgs, isLinearOrder := isLinearOrder, decidableLE := decidableLE,
decidableEq := decidableEq, decidableLT := decidableLT, min := min, max := max,
lawfulOrderLeftLeaningMin := lawfulOrderLeftLeaningMin, lawfulOrderLeftLeaningMax := lawfulOrderLeftLeaningMax,
ord := ord, lawfulOrderOrd := lawfulOrderOrd } =
{ toPartialOrderArgs := toPartialOrderArgs_1, isLinearOrder := isLinearOrder_1, decidableLE := decidableLE_1,
decidableEq := decidableEq_1, decidableLT := decidableLT_1, min := min_1, max := max_1,
lawfulOrderLeftLeaningMin := lawfulOrderLeftLeaningMin_1,
lawfulOrderLeftLeaningMax := lawfulOrderLeftLeaningMax_1, ord := ord_1, lawfulOrderOrd := lawfulOrderOrd_1 }) =
(toPartialOrderArgs = toPartialOrderArgs_1 ∧
decidableLE ≍ decidableLE_1 ∧
decidableEq = decidableEq_1 ∧ decidableLT ≍ decidableLT_1 ∧ min = min_1 ∧ max = max_1 ∧ ord = ord_1)
theorem PartialOrder.OfStdArgs.mk.inj E1 #
∀ {α : Type u_1} {toPreorderArgs : Preorder.OfStdArgs α}
{isPartialOrder :
autoParam
(let this := toPreorderArgs.le;
Std.IsPartialOrder α)
PartialOrder.OfStdArgs.isPartialOrder._autoParam}
{toPreorderArgs_1 : Preorder.OfStdArgs α}
{isPartialOrder_1 :
autoParam
(let this := toPreorderArgs_1.le;
Std.IsPartialOrder α)
PartialOrder.OfStdArgs.isPartialOrder._autoParam},
{ toPreorderArgs := toPreorderArgs, isPartialOrder := isPartialOrder } =
{ toPreorderArgs := toPreorderArgs_1, isPartialOrder := isPartialOrder_1 } →
toPreorderArgs = toPreorderArgs_1
structure Preorder.OfStdArgs E1 #
Type u_1 → Type u_1
Arguments for Preorder.ofStd; see that function for details.
ctor Preorder.OfStdArgs.mk E0 #
{α : Type u_1} →
(le : autoParam (LE α) Preorder.OfStdArgs.le._autoParam) →
(lt :
autoParam
(let this := le;
LT α)
Preorder.OfStdArgs.lt._autoParam) →
autoParam
(let this := le;
let this_1 := lt;
Std.LawfulOrderLT α)
Preorder.OfStdArgs.lawfulOrderLT._autoParam →
autoParam
(let this := le;
Std.IsPreorder α)
Preorder.OfStdArgs.isPreorder._autoParam →
Preorder.OfStdArgs α
abbrev Preorder.OfStdArgs.le E1 #
{α : Type u_1} → Preorder.OfStdArgs α → LE α
The LE instance of the order.
abbrev Preorder.OfStdArgs.lt E1 #
{α : Type u_1} →
(self : Preorder.OfStdArgs α) →
let this := self.le;
LT α
The LT instance of the order.
theorem Preorder.OfStdArgs.lawfulOrderLT E1 #
∀ {α : Type u_1} (self : Preorder.OfStdArgs α),
let this := self.le;
let this_1 := self.lt;
Std.LawfulOrderLT α
a < b is equivalent to a ≤ b ∧ ¬b ≤ a.
theorem Preorder.OfStdArgs.isPreorder E1 #
∀ {α : Type u_1} (self : Preorder.OfStdArgs α),
let this := self.le;
Std.IsPreorder α
≤ forms a preorder.
def Preorder.ofStd E1 #
(α : Type u_1) → autoParam (Preorder.OfStdArgs α) Preorder.ofStd._auto_1 → Preorder α
Create a Preorder from a type satisfying Std.IsPreorder.
If an LE instance exists, either an Std.IsPreorder instance must exist, or there must be an
Ord instance together with Std.LawfulOrderOrd and Std.TransOrd instances.
If no LE instance exists, it can be generated from Ord and Std.TransOrd instances.
If an LT instance exists, an Std.LawfulOrderLT instance must exist also; otherwise, a suitable
LT instance will be generated.
structure PartialOrder.OfStdArgs E1 #
Type u_1 → Type u_1
Arguments for PartialOrder.ofStd; see that function for details.
ctor PartialOrder.OfStdArgs.mk E0 #
{α : Type u_1} →
(toPreorderArgs : Preorder.OfStdArgs α) →
autoParam
(let this := toPreorderArgs.le;
Std.IsPartialOrder α)
PartialOrder.OfStdArgs.isPartialOrder._autoParam →
PartialOrder.OfStdArgs α
abbrev PartialOrder.OfStdArgs.toPreorderArgs E1 #
{α : Type u_1} → PartialOrder.OfStdArgs α → Preorder.OfStdArgs α
theorem PartialOrder.OfStdArgs.isPartialOrder E1 #
∀ {α : Type u_1} (self : PartialOrder.OfStdArgs α),
let this := self.le;
Std.IsPartialOrder α
≤ forms a partial order.
def PartialOrder.ofStd E1 #
(α : Type u_1) → autoParam (PartialOrder.OfStdArgs α) PartialOrder.ofStd._auto_1 → PartialOrder α
Create a PartialOrder from a type satisfying Std.IsPartialOrder.
If an LE instance exists, either an Std.IsPartialOrder instance must exist, or there must be an
Ord instance together with Std.LawfulOrderOrd, Std.LawfulEqOrd, and Std.TransOrd instances.
If no LE instance exists, it can be generated from Ord, Std.LawfulEqOrd, and Std.TransOrd
instances.
If an LT instance exists, an Std.LawfulOrderLT instance must exist also; otherwise, a suitable
LT instance will be generated.
theorem Std.LawfulOrderCmp.compareOfLessAndEq E1 #
∀ (α : Type u_1) [inst : LE α] [inst_1 : LT α] [Std.LawfulOrderLT α] [Std.IsLinearOrder α] [inst_4 : DecidableEq α]
[inst_5 : DecidableLT α], Std.LawfulOrderCmp fun a b ↦ compareOfLessAndEq a b
structure LinearOrder.OfStdArgs E1 #
Type u_1 → Type u_1
Arguments for LinearOrder.ofStd; see that function for details.
abbrev LinearOrder.OfStdArgs.toPartialOrderArgs E1 #
{α : Type u_1} → LinearOrder.OfStdArgs α → PartialOrder.OfStdArgs α
ctor LinearOrder.OfStdArgs.mk E0 #
{α : Type u_1} →
(toPartialOrderArgs : PartialOrder.OfStdArgs α) →
(isLinearOrder :
autoParam
(let this := toPartialOrderArgs.le;
Std.IsLinearOrder α)
LinearOrder.OfStdArgs.isLinearOrder._autoParam) →
(decidableLE : autoParam (DecidableLE α) LinearOrder.OfStdArgs.decidableLE._autoParam) →
(decidableEq :
autoParam
(let this := toPartialOrderArgs;
let this := decidableLE;
DecidableEq α)
LinearOrder.OfStdArgs.decidableEq._autoParam) →
(decidableLT :
autoParam
(let this := toPartialOrderArgs.toPreorderArgs;
let this := decidableLE;
DecidableLT α)
LinearOrder.OfStdArgs.decidableLT._autoParam) →
(min :
autoParam
(let this := toPartialOrderArgs.le;
let this := decidableLE;
Min α)
LinearOrder.OfStdArgs.min._autoParam) →
(max :
autoParam
(let this := toPartialOrderArgs.le;
let this := decidableLE;
Max α)
LinearOrder.OfStdArgs.max._autoParam) →
autoParam (Std.LawfulOrderLeftLeaningMin α) LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMin._autoParam →
autoParam (Std.LawfulOrderLeftLeaningMax α)
LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMax._autoParam →
(ord :
autoParam
(let this := toPartialOrderArgs.lt;
let this := decidableEq;
let this := decidableLT;
Ord α)
LinearOrder.OfStdArgs.ord._autoParam) →
autoParam
(let this := toPartialOrderArgs.le;
let this_1 := toPartialOrderArgs.lt;
let this_2 := ⋯;
let this_3 := isLinearOrder;
let this_4 := decidableEq;
let this_5 := decidableLT;
Std.LawfulOrderOrd α)
LinearOrder.OfStdArgs.lawfulOrderOrd._autoParam →
LinearOrder.OfStdArgs α
theorem LinearOrder.OfStdArgs.isLinearOrder E1 #
∀ {α : Type u_1} (self : LinearOrder.OfStdArgs α),
let this := self.le;
Std.IsLinearOrder α
≤ forms a linear order.
abbrev LinearOrder.OfStdArgs.decidableLE E1 #
{α : Type u_1} → (self : LinearOrder.OfStdArgs α) → DecidableLE α
≤ is decidable.
abbrev LinearOrder.OfStdArgs.decidableEq E1 #
{α : Type u_1} →
(self : LinearOrder.OfStdArgs α) →
let this := self.toPartialOrderArgs;
let this := self.decidableLE;
DecidableEq α
= is decidable. This can always be automatically derived from decidableLE.
abbrev LinearOrder.OfStdArgs.decidableLT E1 #
{α : Type u_1} →
(self : LinearOrder.OfStdArgs α) →
let this := self.toPreorderArgs;
let this := self.decidableLE;
DecidableLT α
< is decidable. This can always be automatically derived from decidableLE.
abbrev LinearOrder.OfStdArgs.min E1 #
{α : Type u_1} →
(self : LinearOrder.OfStdArgs α) →
let this := self.le;
let this := self.decidableLE;
Min α
The Min instance of the order. This can always be automatically derived.
abbrev LinearOrder.OfStdArgs.max E1 #
{α : Type u_1} →
(self : LinearOrder.OfStdArgs α) →
let this := self.le;
let this := self.decidableLE;
Max α
The Max instance of the order. This can always be automatically derived.
theorem LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMin E1 #
∀ {α : Type u_1} (self : LinearOrder.OfStdArgs α), Std.LawfulOrderLeftLeaningMin α
min a b is equivalent to if a ≤ b then a else b.
theorem LinearOrder.OfStdArgs.lawfulOrderLeftLeaningMax E1 #
∀ {α : Type u_1} (self : LinearOrder.OfStdArgs α), Std.LawfulOrderLeftLeaningMax α
max a b is equivalent to if b ≤ a then a else b.
abbrev LinearOrder.OfStdArgs.ord E1 #
{α : Type u_1} →
(self : LinearOrder.OfStdArgs α) →
let this := self.lt;
let this := self.decidableEq;
let this := self.decidableLT;
Ord α
The Ord instance of the order. This can always be automatically derived.
theorem LinearOrder.OfStdArgs.lawfulOrderOrd E1 #
∀ {α : Type u_1} (self : LinearOrder.OfStdArgs α),
let this := self.le;
let this_1 := self.lt;
let this_2 := ⋯;
let this_3 := ⋯;
let this_4 := self.decidableEq;
let this_5 := self.decidableLT;
Std.LawfulOrderOrd α
Ord is compatible with ≤.
def LinearOrder.ofStd E1 #
(α : Type u_1) → autoParam (LinearOrder.OfStdArgs α) LinearOrder.ofStd._auto_1 → LinearOrder α
Create a LinearOrder from a type satisfying Std.IsLinearOrder.
If an LE instance exists, either an Std.IsLinearOrder instance must exist, or there must be an
Ord instance together with Std.LawfulOrderOrd, Std.LawfulEqOrd, and Std.TransOrd instances.
If no LE instance exists, it can be generated from Ord, Std.LawfulEqOrd, and Std.TransOrd
instances.
If an LT instance exists, an Std.LawfulOrderLT instance must exist also; otherwise, a suitable
LT instance will be generated.
If a DecidableLE instance exists, it will be used. Otherwise, it can be generated from an Ord
instance.
If DecidableEq and DecidableLT instances exist, they will be used. Otherwise, they will be
generated from the DecidableLE instance.
If Min and Max instances exist, they will be used, in which case the user must provide
Std.LawfulOrderLeftLeaningMin or Std.LawfulOrderLeftLeaningMax respectively. Otherwise, they
will be generated.
If an Ord instance exists, it will be used, in which case the user must provide an
Std.LawfulOrderOrd instance. Otherwise, it will be generated.