Order intervals #
This file defines (nonempty) closed intervals in an order (see Set.Icc
). This is a prototype for
interval arithmetic.
Main declarations #
NonemptyInterval
: Nonempty intervals. Pairs where the second element is greater than the first.Interval
: Intervals. Either∅
or a nonempty interval.
The nonempty closed intervals in an order.
We define intervals by the pair of endpoints fst
, snd
. To convert intervals to the set of
elements between these endpoints, use the coercion NonemptyInterval α → Set α
.
- fst : α
- snd : α
- fst_le_snd : self.toProd.1 ≤ self.toProd.2
The starting point of an interval is smaller than the endpoint.
Instances For
The injection that induces the order on intervals.
Equations
- NonemptyInterval.toDualProd = NonemptyInterval.toProd
Instances For
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- NonemptyInterval.le = { le := fun (s t : NonemptyInterval α) => t.toProd.1 ≤ s.toProd.1 ∧ s.toProd.2 ≤ t.toProd.2 }
toDualProd
as an order embedding.
Equations
- NonemptyInterval.toDualProdHom = { toFun := NonemptyInterval.toDualProd, inj' := ⋯, map_rel_iff' := ⋯ }
Instances For
Turn an interval into an interval in the dual order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- NonemptyInterval.instPreorder = Preorder.lift NonemptyInterval.toDualProd
Equations
- NonemptyInterval.instCoeSet = { coe := fun (s : NonemptyInterval α) => Set.Icc s.toProd.1 s.toProd.2 }
Equations
- NonemptyInterval.instMembership = { mem := fun (s : NonemptyInterval α) (a : α) => a ∈ Set.Icc s.toProd.1 s.toProd.2 }
{a}
as an interval.
Equations
- NonemptyInterval.pure a = { toProd := (a, a), fst_le_snd := ⋯ }
Instances For
Equations
- NonemptyInterval.instInhabited = { default := NonemptyInterval.pure default }
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Pushforward of nonempty intervals.
Equations
- NonemptyInterval.map f a = { toProd := Prod.map (⇑f) (⇑f) a.toProd, fst_le_snd := ⋯ }
Instances For
Binary pushforward of nonempty intervals.
Equations
- NonemptyInterval.map₂ f h₀ h₁ s t = { toProd := (f s.toProd.1 t.toProd.1, f s.toProd.2 t.toProd.2), fst_le_snd := ⋯ }
Instances For
Equations
- NonemptyInterval.instOrderTop = OrderTop.mk ⋯
Equations
- NonemptyInterval.instPartialOrder = PartialOrder.lift NonemptyInterval.toDualProd ⋯
Consider a nonempty interval [a, b]
as the set [a, b]
.
Equations
- NonemptyInterval.coeHom = OrderEmbedding.ofMapLEIff (fun (s : NonemptyInterval α) => Set.Icc s.toProd.1 s.toProd.2) ⋯
Instances For
Equations
- NonemptyInterval.setLike = { coe := fun (s : NonemptyInterval α) => Set.Icc s.toProd.1 s.toProd.2, coe_injective' := ⋯ }
Equations
- NonemptyInterval.instMax = { max := fun (s t : NonemptyInterval α) => { toProd := (s.toProd.1 ⊓ t.toProd.1, s.toProd.2 ⊔ t.toProd.2), fst_le_snd := ⋯ } }
Equations
- NonemptyInterval.instSemilatticeSup = Function.Injective.semilatticeSup NonemptyInterval.toDualProd ⋯ ⋯
The closed intervals in an order.
We represent intervals either as ⊥
or a nonempty interval given by its endpoints fst
, snd
.
To convert intervals to the set of elements between these endpoints, use the coercion
Interval α → Set α
.
Equations
- Interval α = WithBot (NonemptyInterval α)
Instances For
Equations
- Interval.instCoeNonemptyInterval = WithBot.coe
Recursor for Interval
using the preferred forms ⊥
and ↑a
.
Equations
- Interval.recBotCoe bot coe n = WithBot.recBotCoe bot coe n
Instances For
Equations
- Interval.instUniqueOfIsEmpty = inferInstanceAs (Unique (Option (NonemptyInterval α)))
Equations
- ⋯ = ⋯
Equations
- Interval.boundedOrder = WithBot.instBoundedOrder
Equations
- Interval.partialOrder = WithBot.partialOrder
Consider an interval [a, b]
as the set [a, b]
.
Equations
- Interval.coeHom = OrderEmbedding.ofMapLEIff (fun (s : Interval α) => match s with | none => ∅ | some s => ↑s) ⋯
Instances For
Equations
- Interval.setLike = { coe := ⇑Interval.coeHom, coe_injective' := ⋯ }
Equations
- Interval.semilatticeSup = WithBot.semilatticeSup
Equations
- One or more equations did not get rendered due to their size.
Equations
- Interval.completeLattice = CompleteLattice.mk ⋯ ⋯ ⋯ ⋯ ⋯ ⋯