Orders on a sum type #
This file defines the disjoint sum and the linear (aka lexicographic) sum of two orders and
provides relation instances for Sum.LiftRel
and Sum.Lex
.
We declare the disjoint sum of orders as the default set of instances. The linear order goes on a type synonym.
Main declarations #
Sum.LE
,Sum.LT
: Disjoint sum of orders.Sum.Lex.LE
,Sum.Lex.LT
: Lexicographic/linear sum of orders.
Notation #
α ⊕ₗ β
: The linear sum ofα
andβ
.
Unbundled relation classes #
Disjoint sum of two orders #
Equations
- Sum.instLESum = { le := Sum.LiftRel (fun (x1 x2 : α) => x1 ≤ x2) fun (x1 x2 : β) => x1 ≤ x2 }
Equations
- Sum.instLTSum = { lt := Sum.LiftRel (fun (x1 x2 : α) => x1 < x2) fun (x1 x2 : β) => x1 < x2 }
Equations
- Sum.instPreorderSum = Preorder.mk ⋯ ⋯ ⋯
Equations
Linear sum of two orders #
The linear sum of two orders
Equations
- Sum.Lex.«term_⊕ₗ_» = Lean.ParserDescr.trailingNode `Sum.Lex.«term_⊕ₗ_» 30 0 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊕ₗ ") (Lean.ParserDescr.cat `term 29))
Instances For
The linear/lexicographical ≤
on a sum.
Equations
- Sum.Lex.LE = { le := Sum.Lex (fun (x1 x2 : α) => x1 ≤ x2) fun (x1 x2 : β) => x1 ≤ x2 }
The linear/lexicographical <
on a sum.
Equations
- Sum.Lex.LT = { lt := Sum.Lex (fun (x1 x2 : α) => x1 < x2) fun (x1 x2 : β) => x1 < x2 }
Equations
- Sum.Lex.preorder = Preorder.mk ⋯ ⋯ ⋯
Equations
The lexicographical bottom of a sum is the bottom of the left component.
Equations
The lexicographical top of a sum is the top of the right component.
Equations
Equations
Order isomorphisms #
Equiv.sumComm
promoted to an order isomorphism.
Equations
- OrderIso.sumComm α β = { toEquiv := Equiv.sumComm α β, map_rel_iff' := ⋯ }
Instances For
Equiv.sumAssoc
promoted to an order isomorphism.
Equations
- OrderIso.sumAssoc α β γ = { toEquiv := Equiv.sumAssoc α β γ, map_rel_iff' := ⋯ }
Instances For
WithBot α
is order-isomorphic to PUnit ⊕ₗ α
, by sending ⊥
to Unit
and ↑a
to
a
.
Equations
- WithBot.orderIsoPUnitSumLex = { toEquiv := (Equiv.optionEquivSumPUnit α).trans ((Equiv.sumComm α PUnit.{?u.19 + 1}).trans toLex), map_rel_iff' := ⋯ }
Instances For
WithTop α
is order-isomorphic to α ⊕ₗ PUnit
, by sending ⊤
to Unit
and ↑a
to
a
.
Equations
- WithTop.orderIsoSumLexPUnit = { toEquiv := (Equiv.optionEquivSumPUnit α).trans toLex, map_rel_iff' := ⋯ }