Documentation

Mathlib.Order.Interval

Order intervals #

This file defines (nonempty) closed intervals in an order (see Set.Icc). This is a prototype for interval arithmetic.

Main declarations #

structure NonemptyInterval (α : Type u_7) [LE α] extends Prod :
Type u_7
  • fst : α
  • snd : α
  • fst_le_snd : s.fst s.snd

    The starting point of an interval is smaller than the endpoint.

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 α.

Instances For
    theorem NonemptyInterval.toProd_injective {α : Type u_1} [LE α] :
    Function.Injective NonemptyInterval.toProd
    theorem NonemptyInterval.ext {α : Type u_1} [LE α] (s : NonemptyInterval α) (t : NonemptyInterval α) (h : s.toProd = t.toProd) :
    s = t
    theorem NonemptyInterval.ext_iff {α : Type u_1} [LE α] (s : NonemptyInterval α) (t : NonemptyInterval α) :
    s = t s.toProd = t.toProd
    def NonemptyInterval.toDualProd {α : Type u_1} [LE α] :

    The injection that induces the order on intervals.

    Instances For
      @[simp]
      theorem NonemptyInterval.toDualProd_apply {α : Type u_1} [LE α] (s : NonemptyInterval α) :
      NonemptyInterval.toDualProd s = (OrderDual.toDual s.fst, s.snd)
      theorem NonemptyInterval.toDualProd_injective {α : Type u_1} [LE α] :
      Function.Injective NonemptyInterval.toDualProd
      instance NonemptyInterval.le {α : Type u_1} [LE α] :
      theorem NonemptyInterval.le_def {α : Type u_1} [LE α] {s : NonemptyInterval α} {t : NonemptyInterval α} :
      s t t.fst s.fst s.snd t.snd
      @[simp]
      theorem NonemptyInterval.toDualProdHom_apply {α : Type u_1} [LE α] :
      ∀ (a : NonemptyInterval α), NonemptyInterval.toDualProdHom a = NonemptyInterval.toDualProd a

      toDualProd as an order embedding.

      Instances For

        Turn an interval into an interval in the dual order.

        Instances For
          @[simp]
          theorem NonemptyInterval.fst_dual {α : Type u_1} [LE α] (s : NonemptyInterval α) :
          (NonemptyInterval.dual s).fst = OrderDual.toDual s.snd
          @[simp]
          theorem NonemptyInterval.snd_dual {α : Type u_1} [LE α] (s : NonemptyInterval α) :
          (NonemptyInterval.dual s).snd = OrderDual.toDual s.fst
          @[simp]
          theorem NonemptyInterval.mem_mk {α : Type u_1} [Preorder α] {x : α × α} {a : α} {hx : x.fst x.snd} :
          a { toProd := x, fst_le_snd := hx } x.fst a a x.snd
          theorem NonemptyInterval.mem_def {α : Type u_1} [Preorder α] {s : NonemptyInterval α} {a : α} :
          a s s.fst a a s.snd
          @[simp]
          theorem NonemptyInterval.pure_fst {α : Type u_1} [Preorder α] (a : α) :
          (NonemptyInterval.pure a).toProd.fst = a
          @[simp]
          theorem NonemptyInterval.pure_snd {α : Type u_1} [Preorder α] (a : α) :
          (NonemptyInterval.pure a).toProd.snd = a
          def NonemptyInterval.pure {α : Type u_1} [Preorder α] (a : α) :

          {a} as an interval.

          Instances For
            theorem NonemptyInterval.pure_injective {α : Type u_1} [Preorder α] :
            Function.Injective NonemptyInterval.pure
            @[simp]
            theorem NonemptyInterval.dual_pure {α : Type u_1} [Preorder α] (a : α) :
            NonemptyInterval.dual (NonemptyInterval.pure a) = NonemptyInterval.pure (OrderDual.toDual a)
            @[simp]
            theorem NonemptyInterval.map_snd {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) (a : NonemptyInterval α) :
            (NonemptyInterval.map f a).toProd.snd = f a.1.snd
            @[simp]
            theorem NonemptyInterval.map_fst {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) (a : NonemptyInterval α) :
            (NonemptyInterval.map f a).toProd.fst = f a.1.fst
            def NonemptyInterval.map {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) (a : NonemptyInterval α) :

            Pushforward of nonempty intervals.

            Instances For
              @[simp]
              theorem NonemptyInterval.map_pure {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) (a : α) :
              @[simp]
              theorem NonemptyInterval.map_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Preorder α] [Preorder β] [Preorder γ] (g : β →o γ) (f : α →o β) (a : NonemptyInterval α) :
              @[simp]
              theorem NonemptyInterval.dual_map {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) (a : NonemptyInterval α) :
              NonemptyInterval.dual (NonemptyInterval.map f a) = NonemptyInterval.map (OrderHom.dual f) (NonemptyInterval.dual a)
              @[simp]
              theorem NonemptyInterval.map₂_snd {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Preorder α] [Preorder β] [Preorder γ] (f : αβγ) (h₀ : ∀ (b : β), Monotone fun a => f a b) (h₁ : ∀ (a : α), Monotone (f a)) :
              ∀ (a : NonemptyInterval α) (a_1 : NonemptyInterval β), (NonemptyInterval.map₂ f h₀ h₁ a a_1).toProd.snd = f a.snd a_1.snd
              @[simp]
              theorem NonemptyInterval.map₂_fst {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Preorder α] [Preorder β] [Preorder γ] (f : αβγ) (h₀ : ∀ (b : β), Monotone fun a => f a b) (h₁ : ∀ (a : α), Monotone (f a)) :
              ∀ (a : NonemptyInterval α) (a_1 : NonemptyInterval β), (NonemptyInterval.map₂ f h₀ h₁ a a_1).toProd.fst = f a.fst a_1.fst
              def NonemptyInterval.map₂ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Preorder α] [Preorder β] [Preorder γ] (f : αβγ) (h₀ : ∀ (b : β), Monotone fun a => f a b) (h₁ : ∀ (a : α), Monotone (f a)) :

              Binary pushforward of nonempty intervals.

              Instances For
                @[simp]
                theorem NonemptyInterval.map₂_pure {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Preorder α] [Preorder β] [Preorder γ] (f : αβγ) (h₀ : ∀ (b : β), Monotone fun a => f a b) (h₁ : ∀ (a : α), Monotone (f a)) (a : α) (b : β) :
                @[simp]
                theorem NonemptyInterval.dual_map₂ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Preorder α] [Preorder β] [Preorder γ] (f : αβγ) (h₀ : ∀ (b : β), Monotone fun a => f a b) (h₁ : ∀ (a : α), Monotone (f a)) (s : NonemptyInterval α) (t : NonemptyInterval β) :
                NonemptyInterval.dual (NonemptyInterval.map₂ f h₀ h₁ s t) = NonemptyInterval.map₂ (fun a b => OrderDual.toDual (f (OrderDual.ofDual a) (OrderDual.ofDual b))) (_ : ∀ (x : βᵒᵈ), Monotone (OrderDual.toDual (fun a => f a (OrderDual.ofDual x)) OrderDual.ofDual)) (_ : ∀ (x : αᵒᵈ), Monotone (OrderDual.toDual f (OrderDual.ofDual x) OrderDual.ofDual)) (NonemptyInterval.dual s) (NonemptyInterval.dual t)
                @[simp]
                theorem NonemptyInterval.dual_top {α : Type u_1} [Preorder α] [BoundedOrder α] :
                NonemptyInterval.dual =

                Consider a nonempty interval [a, b] as the set [a, b].

                Instances For
                  theorem NonemptyInterval.coe_subset_coe {α : Type u_1} [PartialOrder α] {s : NonemptyInterval α} {t : NonemptyInterval α} :
                  s t s t
                  theorem NonemptyInterval.coe_ssubset_coe {α : Type u_1} [PartialOrder α] {s : NonemptyInterval α} {t : NonemptyInterval α} :
                  s t s < t
                  @[simp]
                  theorem NonemptyInterval.coe_coeHom {α : Type u_1} [PartialOrder α] :
                  NonemptyInterval.coeHom = SetLike.coe
                  @[simp]
                  theorem NonemptyInterval.coe_pure {α : Type u_1} [PartialOrder α] (a : α) :
                  @[simp]
                  theorem NonemptyInterval.mem_pure {α : Type u_1} [PartialOrder α] {a : α} {b : α} :
                  @[simp]
                  theorem NonemptyInterval.coe_top {α : Type u_1} [PartialOrder α] [BoundedOrder α] :
                  = Set.univ
                  @[simp]
                  theorem NonemptyInterval.coe_dual {α : Type u_1} [PartialOrder α] (s : NonemptyInterval α) :
                  ↑(NonemptyInterval.dual s) = OrderDual.ofDual ⁻¹' s
                  theorem NonemptyInterval.subset_coe_map {α : Type u_1} {β : Type u_2} [PartialOrder α] [PartialOrder β] (f : α →o β) (s : NonemptyInterval α) :
                  f '' s ↑(NonemptyInterval.map f s)
                  @[simp]
                  theorem NonemptyInterval.fst_sup {α : Type u_1} [Lattice α] (s : NonemptyInterval α) (t : NonemptyInterval α) :
                  (s t).fst = s.fst t.fst
                  @[simp]
                  theorem NonemptyInterval.snd_sup {α : Type u_1} [Lattice α] (s : NonemptyInterval α) (t : NonemptyInterval α) :
                  (s t).snd = s.snd t.snd
                  @[reducible]
                  def Interval (α : Type u_7) [LE α] :
                  Type u_7

                  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 α.

                  Instances For
                    instance Interval.instLEInterval {α : Type u_1} [LE α] :
                    instance Interval.canLift {α : Type u_1} [LE α] :
                    CanLift (Interval α) (NonemptyInterval α) WithBot.some fun r => r
                    theorem Interval.coe_injective {α : Type u_1} [LE α] :
                    Function.Injective WithBot.some
                    theorem Interval.coe_inj {α : Type u_1} [LE α] {s : NonemptyInterval α} {t : NonemptyInterval α} :
                    s = t s = t
                    theorem Interval.forall {α : Type u_1} [LE α] {p : Interval αProp} :
                    ((s : Interval α) → p s) p ((s : NonemptyInterval α) → p s)
                    theorem Interval.exists {α : Type u_1} [LE α] {p : Interval αProp} :
                    (s, p s) p s, p s
                    instance Interval.instUniqueInterval {α : Type u_1} [LE α] [IsEmpty α] :
                    def Interval.dual {α : Type u_1} [LE α] :

                    Turn an interval into an interval in the dual order.

                    Instances For
                      def Interval.pure {α : Type u_1} [Preorder α] (a : α) :

                      {a} as an interval.

                      Instances For
                        theorem Interval.pure_injective {α : Type u_1} [Preorder α] :
                        Function.Injective Interval.pure
                        @[simp]
                        theorem Interval.dual_pure {α : Type u_1} [Preorder α] (a : α) :
                        Interval.dual (Interval.pure a) = Interval.pure (OrderDual.toDual a)
                        @[simp]
                        theorem Interval.dual_bot {α : Type u_1} [Preorder α] :
                        Interval.dual =
                        @[simp]
                        theorem Interval.pure_ne_bot {α : Type u_1} [Preorder α] {a : α} :
                        @[simp]
                        theorem Interval.bot_ne_pure {α : Type u_1} [Preorder α] {a : α} :
                        def Interval.map {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) :
                        Interval αInterval β

                        Pushforward of intervals.

                        Instances For
                          @[simp]
                          theorem Interval.map_pure {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) (a : α) :
                          @[simp]
                          theorem Interval.map_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Preorder α] [Preorder β] [Preorder γ] (g : β →o γ) (f : α →o β) (s : Interval α) :
                          @[simp]
                          theorem Interval.dual_map {α : Type u_1} {β : Type u_2} [Preorder α] [Preorder β] (f : α →o β) (s : Interval α) :
                          Interval.dual (Interval.map f s) = Interval.map (OrderHom.dual f) (Interval.dual s)
                          @[simp]
                          theorem Interval.dual_top {α : Type u_1} [Preorder α] [BoundedOrder α] :
                          Interval.dual =
                          def Interval.coeHom {α : Type u_1} [PartialOrder α] :

                          Consider an interval [a, b] as the set [a, b].

                          Instances For
                            instance Interval.setLike {α : Type u_1} [PartialOrder α] :
                            theorem Interval.coe_subset_coe {α : Type u_1} [PartialOrder α] {s : Interval α} {t : Interval α} :
                            s t s t
                            theorem Interval.coe_sSubset_coe {α : Type u_1} [PartialOrder α] {s : Interval α} {t : Interval α} :
                            s t s < t
                            @[simp]
                            theorem Interval.coe_pure {α : Type u_1} [PartialOrder α] (a : α) :
                            ↑(Interval.pure a) = {a}
                            @[simp]
                            theorem Interval.coe_coe {α : Type u_1} [PartialOrder α] (s : NonemptyInterval α) :
                            s = s
                            @[simp]
                            theorem Interval.coe_bot {α : Type u_1} [PartialOrder α] :
                            =
                            @[simp]
                            theorem Interval.coe_top {α : Type u_1} [PartialOrder α] [BoundedOrder α] :
                            = Set.univ
                            @[simp]
                            theorem Interval.coe_dual {α : Type u_1} [PartialOrder α] (s : Interval α) :
                            ↑(Interval.dual s) = OrderDual.ofDual ⁻¹' s
                            theorem Interval.subset_coe_map {α : Type u_1} {β : Type u_2} [PartialOrder α] [PartialOrder β] (f : α →o β) (s : Interval α) :
                            f '' s ↑(Interval.map f s)
                            @[simp]
                            theorem Interval.mem_pure {α : Type u_1} [PartialOrder α] {a : α} {b : α} :
                            theorem Interval.mem_pure_self {α : Type u_1} [PartialOrder α] (a : α) :
                            instance Interval.lattice {α : Type u_1} [Lattice α] [DecidableRel fun x x_1 => x x_1] :
                            @[simp]
                            theorem Interval.coe_inf {α : Type u_1} [Lattice α] [DecidableRel fun x x_1 => x x_1] (s : Interval α) (t : Interval α) :
                            ↑(s t) = s t
                            @[simp]
                            theorem Interval.disjoint_coe {α : Type u_1} [Lattice α] (s : Interval α) (t : Interval α) :
                            Disjoint s t Disjoint s t
                            @[simp]
                            @[simp]
                            @[simp]
                            theorem NonemptyInterval.mem_coe_interval {α : Type u_1} [PartialOrder α] {s : NonemptyInterval α} {x : α} :
                            x s x s
                            @[simp]
                            theorem NonemptyInterval.coe_sup_interval {α : Type u_1} [Lattice α] (s : NonemptyInterval α) (t : NonemptyInterval α) :
                            ↑(s t) = s t
                            noncomputable instance Interval.completeLattice {α : Type u_1} [CompleteLattice α] [DecidableRel fun x x_1 => x x_1] :
                            @[simp]
                            theorem Interval.coe_sInf {α : Type u_1} [CompleteLattice α] [DecidableRel fun x x_1 => x x_1] (S : Set (Interval α)) :
                            ↑(sInf S) = ⋂ (s : Interval α) (_ : s S), s
                            @[simp]
                            theorem Interval.coe_iInf {α : Type u_1} {ι : Sort u_5} [CompleteLattice α] [DecidableRel fun x x_1 => x x_1] (f : ιInterval α) :
                            ↑(⨅ (i : ι), f i) = ⋂ (i : ι), ↑(f i)
                            theorem Interval.coe_iInf₂ {α : Type u_1} {ι : Sort u_5} {κ : ιSort u_6} [CompleteLattice α] [DecidableRel fun x x_1 => x x_1] (f : (i : ι) → κ iInterval α) :
                            ↑(⨅ (i : ι) (j : κ i), f i j) = ⋂ (i : ι) (j : κ i), ↑(f i j)