Order intervals #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines (nonempty) closed intervals in an order (see set.Icc). This is a prototype for
interval arithmetic.
Main declarations #
nonempty_interval: 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 nonempty_interval α → set α.
Instances for nonempty_interval
- nonempty_interval.has_mem
- nonempty_interval.has_sizeof_inst
- nonempty_interval.is_empty
- nonempty_interval.subsingleton
- nonempty_interval.has_le
- nonempty_interval.preorder
- nonempty_interval.set.has_coe_t
- nonempty_interval.inhabited
- nonempty_interval.nonempty
- nonempty_interval.nontrivial
- nonempty_interval.order_top
- nonempty_interval.partial_order
- nonempty_interval.set_like
- nonempty_interval.has_sup
- nonempty_interval.semilattice_sup
- interval.has_coe_t
- interval.can_lift
- nonempty_interval.has_one
- nonempty_interval.has_zero
- nonempty_interval.has_mul
- nonempty_interval.has_add
- nonempty_interval.has_nsmul
- nonempty_interval.has_pow
- nonempty_interval.comm_monoid
- nonempty_interval.add_comm_monoid
- nonempty_interval.has_sub
- nonempty_interval.has_div
- nonempty_interval.has_inv
- nonempty_interval.has_neg
- nonempty_interval.subtraction_comm_monoid
- nonempty_interval.division_comm_monoid
The injection that induces the order on intervals.
to_dual_prod as an order embedding.
Equations
- nonempty_interval.to_dual_prod_hom = {to_embedding := {to_fun := nonempty_interval.to_dual_prod _inst_1, inj' := _}, map_rel_iff' := _}
Turn an interval into an interval in the dual order.
Equations
- nonempty_interval.dual = {to_fun := λ (s : nonempty_interval α), {to_prod := s.to_prod.swap, fst_le_snd := _}, inv_fun := λ (s : nonempty_interval αᵒᵈ), {to_prod := s.to_prod.swap, fst_le_snd := _}, left_inv := _, right_inv := _}
Equations
- nonempty_interval.set.has_coe_t = {coe := λ (s : nonempty_interval α), set.Icc s.to_prod.fst s.to_prod.snd}
Equations
- nonempty_interval.has_mem = {mem := λ (a : α) (s : nonempty_interval α), a ∈ ↑s}
{a} as an interval.
Equations
- nonempty_interval.pure a = {to_prod := (a, a), fst_le_snd := _}
Pushforward of nonempty intervals.
Equations
- nonempty_interval.map f a = {to_prod := prod.map ⇑f ⇑f a.to_prod, fst_le_snd := _}
Binary pushforward of nonempty intervals.
Equations
- nonempty_interval.map₂ f h₀ h₁ = λ (s : nonempty_interval α) (t : nonempty_interval β), {to_prod := (f s.to_prod.fst t.to_prod.fst, f s.to_prod.snd t.to_prod.snd), fst_le_snd := _}
Equations
- nonempty_interval.order_top = {top := {to_prod := (⊥, ⊤), fst_le_snd := _}, le_top := _}
Equations
- nonempty_interval.partial_order = partial_order.lift nonempty_interval.to_dual_prod nonempty_interval.partial_order._proof_1
Consider a nonempty interval [a, b] as the set [a, b].
Equations
- nonempty_interval.coe_hom = order_embedding.of_map_le_iff (λ (s : nonempty_interval α), set.Icc s.to_prod.fst s.to_prod.snd) nonempty_interval.coe_hom._proof_1
Equations
- nonempty_interval.set_like = {coe := λ (s : nonempty_interval α), set.Icc s.to_prod.fst s.to_prod.snd, coe_injective' := _}
Equations
- nonempty_interval.semilattice_sup = function.injective.semilattice_sup nonempty_interval.to_dual_prod nonempty_interval.semilattice_sup._proof_1 nonempty_interval.semilattice_sup._proof_2
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 α = with_bot (nonempty_interval α)
Instances for interval
- interval.inhabited
- interval.has_le
- interval.order_bot
- interval.has_coe_t
- interval.can_lift
- interval.unique
- interval.preorder
- interval.nontrivial
- interval.bounded_order
- interval.partial_order
- interval.set_like
- interval.semilattice_sup
- interval.lattice
- interval.complete_lattice
- interval.has_one
- interval.has_zero
- interval.has_mul
- interval.has_add
- interval.mul_one_class
- interval.add_zero_class
- interval.comm_monoid
- interval.add_comm_monoid
- interval.has_sub
- interval.has_div
- interval.has_inv
- interval.has_neg
- interval.subtraction_comm_monoid
- interval.division_comm_monoid
Equations
Equations
Turn an interval into an interval in the dual order.
Equations
Equations
{a} as an interval.
Equations
Equations
Equations
Consider a interval [a, b] as the set [a, b].
Equations
- interval.coe_hom = order_embedding.of_map_le_iff (λ (s : interval α), interval.coe_hom._match_1 s) interval.coe_hom._proof_1
- interval.coe_hom._match_1 (option.some s) = ↑s
- interval.coe_hom._match_1 ⊥ = ∅
Equations
- interval.set_like = {coe := ⇑interval.coe_hom, coe_injective' := _}
Equations
- interval.lattice = {sup := semilattice_sup.sup interval.semilattice_sup, le := semilattice_sup.le interval.semilattice_sup, lt := semilattice_sup.lt interval.semilattice_sup, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := λ (s t : interval α), interval.lattice._match_1 s t, inf_le_left := _, inf_le_right := _, le_inf := _}
- interval.lattice._match_1 (option.some s) (option.some t) = dite (s.to_prod.fst ≤ t.to_prod.snd ∧ t.to_prod.fst ≤ s.to_prod.snd) (λ (h : s.to_prod.fst ≤ t.to_prod.snd ∧ t.to_prod.fst ≤ s.to_prod.snd), option.some {to_prod := (s.to_prod.fst ⊔ t.to_prod.fst, s.to_prod.snd ⊓ t.to_prod.snd), fst_le_snd := _}) (λ (h : ¬(s.to_prod.fst ≤ t.to_prod.snd ∧ t.to_prod.fst ≤ s.to_prod.snd)), ⊥)
- interval.lattice._match_1 (option.some val) ⊥ = ⊥
- interval.lattice._match_1 ⊥ (option.some val) = ⊥
- interval.lattice._match_1 ⊥ option.none = ⊥
Equations
- interval.complete_lattice = {sup := lattice.sup interval.lattice, le := lattice.le interval.lattice, lt := lattice.lt interval.lattice, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := lattice.inf interval.lattice, inf_le_left := _, inf_le_right := _, le_inf := _, Sup := λ (S : set (interval α)), dite (S ⊆ {⊥}) (λ (h : S ⊆ {⊥}), ⊥) (λ (h : ¬S ⊆ {⊥}), option.some {to_prod := (⨅ (s : nonempty_interval α) (h : ↑s ∈ S), s.to_prod.fst, ⨆ (s : nonempty_interval α) (h : ↑s ∈ S), s.to_prod.snd), fst_le_snd := _}), le_Sup := _, Sup_le := _, Inf := λ (S : set (interval α)), dite (⊥ ∉ S ∧ ∀ ⦃s : nonempty_interval α⦄, ↑s ∈ S → ∀ ⦃t : nonempty_interval α⦄, ↑t ∈ S → s.to_prod.fst ≤ t.to_prod.snd) (λ (h : ⊥ ∉ S ∧ ∀ ⦃s : nonempty_interval α⦄, ↑s ∈ S → ∀ ⦃t : nonempty_interval α⦄, ↑t ∈ S → s.to_prod.fst ≤ t.to_prod.snd), option.some {to_prod := (⨆ (s : nonempty_interval α) (h : ↑s ∈ S), s.to_prod.fst, ⨅ (s : nonempty_interval α) (h : ↑s ∈ S), s.to_prod.snd), fst_le_snd := _}) (λ (h : ¬(⊥ ∉ S ∧ ∀ ⦃s : nonempty_interval α⦄, ↑s ∈ S → ∀ ⦃t : nonempty_interval α⦄, ↑t ∈ S → s.to_prod.fst ≤ t.to_prod.snd)), ⊥), Inf_le := _, le_Inf := _, top := bounded_order.top interval.bounded_order, bot := bounded_order.bot interval.bounded_order, le_top := _, bot_le := _}