Documentation

TauCeti.Analysis.Convex.Sequence.SlopeData.Basic

Slope presentations of convex height sequences #

A nonempty convex polygon is determined by its first point and the slopes of its unit edges. This file gives the two one-sided presentations of that kind.

The slopes and the initial height lie in a preordered additive commutative monoid Γ, such as ℕ, ℚ or ℝ, rather than in a type containing slope sentinels. The represented heights are cumulative sums on the finite domain and ⊤ outside it, so every actual edge has horizontal length one.

Main results #

References #

Finite slope data #

structure TauCeti.FiniteSlopeData (Γ : Type u_3) [Preorder Γ] :
Type u_3

The unit-slope presentation of a nonempty convex polygon with finite domain [start, start + length]. The edge from start + i to start + i + 1 has slope slope i. Length zero represents a singleton polygon and carries no slopes.

  • start : ℕ

    The first index of the finite domain.

  • initialHeight : Γ

    The height at the first index.

  • length : ℕ

    The horizontal length of the polygon, which is also its number of unit edges.

  • slope : Fin self.length → Γ

    The slope of the i-th unit edge, counted from the left.

  • monotone : Monotone self.slope

    Slopes are nondecreasing from left to right.

Instances For
    theorem TauCeti.FiniteSlopeData.ext_of_slope {Γ : Type u_1} [Preorder Γ] {d e : FiniteSlopeData Γ} (hs : d.start = e.start) (hy : d.initialHeight = e.initialHeight) (hl : d.length = e.length) (hm : ∀ (i : Fin d.length), d.slope i = e.slope (Fin.cast hl i)) :
    d = e

    Finite slope data is determined by its anchor, length and pointwise unit slopes, transported along the equality of lengths.

    The heights represented by finite slope data: cumulative slope sums on [start, start + length] and ⊤ elsewhere.

    Instances For

      The defining formula of FiniteSlopeData.heights at an arbitrary index.

      The represented heights are finite exactly on [start, start + length].

      @[simp]

      The represented heights are infinite exactly outside [start, start + length].

      The finite domain of the represented heights is [start, start + length].

      @[simp]
      theorem TauCeti.FiniteSlopeData.heights_start_add {Γ : Type u_1} [Preorder Γ] [AddCommMonoid Γ] (d : FiniteSlopeData Γ) {k : ℕ} (hk : k ≤ d.length) :

      On the finite domain, the height is the initial height plus a partial slope sum.

      @[simp]

      The height at the first index is the initial height.

      The height at the right endpoint exceeds the initial height by the sum of all slopes.

      def TauCeti.FiniteSlopeData.map {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : FiniteSlopeData Γ) (f : Γ →+o Γ') :

      Transport finite slope data along an order-preserving additive map of value monoids.

      Instances For
        @[simp]
        theorem TauCeti.FiniteSlopeData.map_start {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : FiniteSlopeData Γ) (f : Γ →+o Γ') :
        (d.map f).start = d.start
        @[simp]
        theorem TauCeti.FiniteSlopeData.map_initialHeight {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : FiniteSlopeData Γ) (f : Γ →+o Γ') :
        @[simp]
        theorem TauCeti.FiniteSlopeData.map_length {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : FiniteSlopeData Γ) (f : Γ →+o Γ') :
        (d.map f).length = d.length
        @[simp]
        theorem TauCeti.FiniteSlopeData.map_slope {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : FiniteSlopeData Γ) (f : Γ →+o Γ') (i : Fin (d.map f).length) :
        (d.map f).slope i = f (d.slope (Fin.cast ⋯ i))
        @[simp]
        theorem TauCeti.FiniteSlopeData.heights_map {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : FiniteSlopeData Γ) (f : Γ →+o Γ') (n : ℕ) :
        (d.map f).heights n = WithTop.map (⇑f) (d.heights n)

        The heights of transported slope data are the transported heights.

        Finite slope data is determined by the heights it represents: the starting index, the initial height, the length and every slope agree.

        Infinite slope data #

        structure TauCeti.InfiniteSlopeData (Γ : Type u_3) [Preorder Γ] :
        Type u_3

        The unit-slope presentation of a convex polygon whose finite domain is the half-line [start, ∞). The edge from start + i to start + i + 1 has slope slope i. A terminal ray is an eventually constant slope sequence; no slope is infinite.

        • start : ℕ

          The first index of the finite domain.

        • initialHeight : Γ

          The height at the first index.

        • slope : ℕ → Γ

          The slope of the i-th unit edge, counted from the left.

        • monotone : Monotone self.slope

          Slopes are nondecreasing from left to right.

        Instances For
          theorem TauCeti.InfiniteSlopeData.ext {Γ : Type u_3} {inst✝ : Preorder Γ} {x y : InfiniteSlopeData Γ} (start : x.start = y.start) (initialHeight : x.initialHeight = y.initialHeight) (slope : x.slope = y.slope) :
          x = y

          Keep the anchor and first n unit slopes of an infinite slope presentation. For n = 0 the truncation is the singleton at the anchor.

          Instances For
            @[simp]
            @[simp]
            theorem TauCeti.InfiniteSlopeData.truncate_slope {Γ : Type u_1} [Preorder Γ] (d : InfiniteSlopeData Γ) (n : ℕ) (i : Fin (d.truncate n).length) :
            (d.truncate n).slope i = d.slope ↑i

            The heights represented by infinite slope data: cumulative slope sums from start onwards and ⊤ before it.

            Instances For
              theorem TauCeti.InfiniteSlopeData.heights_def {Γ : Type u_1} [Preorder Γ] [AddCommMonoid Γ] (d : InfiniteSlopeData Γ) (n : ℕ) :
              d.heights n = if d.start ≤ n then ↑(d.initialHeight + ∑ i ∈ Finset.range (n - d.start), d.slope i) else ⊤

              The defining formula of InfiniteSlopeData.heights at an arbitrary index.

              The represented heights are finite exactly on [start, ∞).

              @[simp]

              The represented heights are infinite exactly before start.

              The finite domain of the represented heights is [start, ∞).

              @[simp]
              theorem TauCeti.InfiniteSlopeData.heights_start_add {Γ : Type u_1} [Preorder Γ] [AddCommMonoid Γ] (d : InfiniteSlopeData Γ) (k : ℕ) :
              d.heights (d.start + k) = ↑(d.initialHeight + ∑ i ∈ Finset.range k, d.slope i)

              On the finite domain, the height is the initial height plus a partial slope sum.

              @[simp]
              theorem TauCeti.InfiniteSlopeData.heights_truncate_start_add {Γ : Type u_1} [Preorder Γ] [AddCommMonoid Γ] (d : InfiniteSlopeData Γ) (n : ℕ) {k : ℕ} (hk : k ≤ n) :
              (d.truncate n).heights (d.start + k) = d.heights (d.start + k)

              Truncation preserves heights on the interval from the anchor to its endpoint.

              @[simp]

              The height at the first index is the initial height.

              def TauCeti.InfiniteSlopeData.map {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : InfiniteSlopeData Γ) (f : Γ →+o Γ') :

              Transport infinite slope data along an order-preserving additive map of value monoids.

              Instances For
                @[simp]
                theorem TauCeti.InfiniteSlopeData.map_start {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : InfiniteSlopeData Γ) (f : Γ →+o Γ') :
                (d.map f).start = d.start
                @[simp]
                theorem TauCeti.InfiniteSlopeData.map_initialHeight {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : InfiniteSlopeData Γ) (f : Γ →+o Γ') :
                @[simp]
                theorem TauCeti.InfiniteSlopeData.map_slope {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : InfiniteSlopeData Γ) (f : Γ →+o Γ') (i : ℕ) :
                (d.map f).slope i = f (d.slope i)
                @[simp]
                theorem TauCeti.InfiniteSlopeData.heights_map {Γ : Type u_1} {Γ' : Type u_2} [Preorder Γ] [Preorder Γ'] [AddCommMonoid Γ] [AddCommMonoid Γ'] (d : InfiniteSlopeData Γ) (f : Γ →+o Γ') (n : ℕ) :
                (d.map f).heights n = WithTop.map (⇑f) (d.heights n)

                The heights of transported slope data are the transported heights.

                Infinite slope data is determined by the heights it represents: the starting index, the initial height and every slope agree.

                Real slope data and convex height sequences #

                @[simp]

                The unit slopes of the represented heights are the given slopes.

                Real finite slope data represents a convex height sequence.

                noncomputable def TauCeti.FiniteSlopeData.ofIsConvexSeq {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l k : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n ∧ n ≤ l + k) :

                The finite slope data of a convex height sequence whose finite domain is [l, l + k].

                Instances For
                  @[simp]
                  theorem TauCeti.FiniteSlopeData.ofIsConvexSeq_start {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l k : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n ∧ n ≤ l + k) :
                  (ofIsConvexSeq hh hdom).start = l
                  @[simp]
                  theorem TauCeti.FiniteSlopeData.ofIsConvexSeq_initialHeight {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l k : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n ∧ n ≤ l + k) :
                  @[simp]
                  theorem TauCeti.FiniteSlopeData.ofIsConvexSeq_length {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l k : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n ∧ n ≤ l + k) :
                  (ofIsConvexSeq hh hdom).length = k
                  @[simp]
                  theorem TauCeti.FiniteSlopeData.ofIsConvexSeq_slope {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l k : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n ∧ n ≤ l + k) (i : Fin (ofIsConvexSeq hh hdom).length) :
                  (ofIsConvexSeq hh hdom).slope i = unitSlope h (l + ↑i)
                  @[simp]
                  theorem TauCeti.FiniteSlopeData.heights_ofIsConvexSeq {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l k : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n ∧ n ≤ l + k) :
                  (ofIsConvexSeq hh hdom).heights = h

                  Extracting slope data and reconstructing heights recovers the height sequence.

                  @[simp]

                  Reconstructing heights and extracting slope data recovers the slope data.

                  A real height sequence is represented by finite slope data exactly when it is convex and its finite domain is nonempty and finite.

                  @[simp]

                  The unit slopes of the represented heights are the given slopes.

                  Real infinite slope data represents a convex height sequence.

                  noncomputable def TauCeti.InfiniteSlopeData.ofIsConvexSeq {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n) :

                  The infinite slope data of a convex height sequence whose finite domain is [l, ∞).

                  Instances For
                    @[simp]
                    theorem TauCeti.InfiniteSlopeData.ofIsConvexSeq_start {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n) :
                    (ofIsConvexSeq hh hdom).start = l
                    @[simp]
                    theorem TauCeti.InfiniteSlopeData.ofIsConvexSeq_initialHeight {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n) :
                    @[simp]
                    theorem TauCeti.InfiniteSlopeData.ofIsConvexSeq_slope {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n) (i : ℕ) :
                    (ofIsConvexSeq hh hdom).slope i = unitSlope h (l + i)
                    @[simp]
                    theorem TauCeti.InfiniteSlopeData.heights_ofIsConvexSeq {h : ℕ → WithTop ℝ} (hh : IsConvexSeq h) {l : ℕ} (hdom : ∀ (n : ℕ), h n ≠ ⊤ ↔ l ≤ n) :
                    (ofIsConvexSeq hh hdom).heights = h

                    Extracting slope data and reconstructing heights recovers the height sequence.

                    @[simp]

                    Reconstructing heights and extracting slope data recovers the slope data.

                    A real height sequence is represented by infinite slope data exactly when it is convex and its finite domain is infinite.