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
- (_ : IsEmpty (NonemptyInterval α)) = (_ : IsEmpty (NonemptyInterval α))
Equations
- (_ : Subsingleton (NonemptyInterval α)) = (_ : Subsingleton (NonemptyInterval α))
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
- One or more equations did not get rendered due to their size.
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.instPreorderNonemptyIntervalToLE = Preorder.lift NonemptyInterval.toDualProd
Equations
- NonemptyInterval.instCoeNonemptyIntervalToLESet = { coe := fun (s : NonemptyInterval α) => Set.Icc s.toProd.1 s.toProd.2 }
Equations
- NonemptyInterval.instMembershipNonemptyIntervalToLE = { mem := fun (a : α) (s : NonemptyInterval α) => a ∈ Set.Icc s.toProd.1 s.toProd.2 }
{a}
as an interval.
Equations
- NonemptyInterval.pure a = { toProd := (a, a), fst_le_snd := (_ : (a, a).1 ≤ (a, a).1) }
Instances For
Equations
- NonemptyInterval.instInhabitedNonemptyIntervalToLE = { default := NonemptyInterval.pure default }
Equations
- (_ : Nonempty (NonemptyInterval α)) = (_ : Nonempty (NonemptyInterval α))
Equations
- (_ : Nontrivial (NonemptyInterval α)) = (_ : Nontrivial (NonemptyInterval α))
Pushforward of nonempty intervals.
Equations
- NonemptyInterval.map f a = { toProd := Prod.map (⇑f) (⇑f) a.toProd, fst_le_snd := (_ : f a.1.1 ≤ f a.1.2) }
Instances For
Binary pushforward of nonempty intervals.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- NonemptyInterval.instOrderTopNonemptyIntervalToLELe = OrderTop.mk (_ : ∀ (x : NonemptyInterval α), ⊤.toProd.1 ≤ x.toProd.1 ∧ x.toProd.2 ≤ ⊤.toProd.2)
Equations
- NonemptyInterval.instPartialOrderNonemptyIntervalToLEToPreorder = PartialOrder.lift NonemptyInterval.toDualProd (_ : Function.Injective NonemptyInterval.toDualProd)
Consider a nonempty interval [a, b]
as the set [a, b]
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- NonemptyInterval.setLike = { coe := fun (s : NonemptyInterval α) => Set.Icc s.toProd.1 s.toProd.2, coe_injective' := (_ : Function.Injective ⇑NonemptyInterval.coeHom) }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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.instCoeNonemptyIntervalInterval = WithBot.coe
Equations
- One or more equations did not get rendered due to their size.
Equations
- Interval.instUniqueInterval = inferInstanceAs (Unique (Option (NonemptyInterval α)))
Turn an interval into an interval in the dual order.
Equations
- Interval.dual = Equiv.optionCongr NonemptyInterval.dual
Instances For
Equations
- (_ : Nontrivial (Interval α)) = (_ : Nontrivial (Option (NonemptyInterval α)))
Equations
- Interval.boundedOrder = WithBot.instBoundedOrder
Equations
- Interval.partialOrder = WithBot.partialOrder
Consider an interval [a, b]
as the set [a, b]
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Interval.setLike = { coe := ⇑Interval.coeHom, coe_injective' := (_ : Function.Injective ⇑Interval.coeHom) }
Equations
- Interval.semilatticeSup = WithBot.semilatticeSup
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.