Documentation

Init.Data.String.Termination

Helpers for termination arguments about functions operating on strings #

The number of bytes between p and the end position. This number decreases as p advances.

Equations
    Instances For
      theorem String.Slice.Pos.wellFounded_lt {s : Slice} :
      WellFounded fun (p q : s.Pos) => p < q
      theorem String.Slice.Pos.wellFounded_gt {s : Slice} :
      WellFounded fun (p q : s.Pos) => q < p

      Type alias for String.Slice.Pos representing that the given position is expected to decrease in recursive calls.

      Instances For
        def String.Slice.Pos.down {s : Slice} (p : s.Pos) :

        Use termination_by pos.down to signify that in a recursive call, the parameter pos is expected to decrease.

        Equations
          Instances For
            @[simp]
            theorem String.Slice.Pos.inner_down {s : Slice} {p : s.Pos} :
            theorem String.Slice.Pos.eq_next_of_next?_eq_some {s : Slice} {p q : s.Pos} (h : p.next? = some q) :
            q = p.next
            theorem String.Slice.Pos.eq_prev_of_prev?_eq_some {s : Slice} {p q : s.Pos} (h : p.prev? = some q) :
            q = p.prev
            @[simp]
            theorem String.Slice.Pos.le_refl {s : Slice} (p : s.Pos) :
            p p
            theorem String.Slice.Pos.lt_trans {s : Slice} {p q r : s.Pos} :
            p < qq < rp < r
            @[simp]
            theorem String.Slice.Pos.lt_next_next {s : Slice} {p : s.Pos} {h : p s.endPos} {h' : p.next h s.endPos} :
            p < (p.next h).next h'
            @[simp]
            theorem String.Slice.Pos.prev_prev_lt {s : Slice} {p : s.Pos} {h : p s.startPos} {h' : p.prev h s.startPos} :
            (p.prev h).prev h' < p

            The number of bytes between p and the end position. This number decreases as p advances.

            Equations
              Instances For
                theorem String.Pos.wellFounded_lt {s : String} :
                WellFounded fun (p q : s.Pos) => p < q
                theorem String.Pos.wellFounded_gt {s : String} :
                WellFounded fun (p q : s.Pos) => q < p
                structure String.Pos.Down (s : String) :

                Type alias for String.Pos representing that the given position is expected to decrease in recursive calls.

                Instances For
                  def String.Pos.down {s : String} (p : s.Pos) :

                  Use termination_by pos.down to signify that in a recursive call, the parameter pos is expected to decrease.

                  Equations
                    Instances For
                      @[simp]
                      theorem String.Pos.inner_down {s : String} {p : s.Pos} :
                      theorem String.Pos.eq_next_of_next?_eq_some {s : String} {p q : s.Pos} (h : p.next? = some q) :
                      q = p.next
                      theorem String.Pos.eq_prev_of_prev?_eq_some {s : String} {p q : s.Pos} (h : p.prev? = some q) :
                      q = p.prev
                      @[simp]
                      theorem String.Pos.le_refl {s : String} (p : s.Pos) :
                      p p
                      theorem String.Pos.lt_trans {s : String} {p q r : s.Pos} :
                      p < qq < rp < r
                      @[simp]
                      theorem String.Pos.lt_next_next {s : String} {p : s.Pos} {h : p s.endPos} {h' : p.next h s.endPos} :
                      p < (p.next h).next h'
                      @[simp]
                      theorem String.Pos.prev_prev_lt {s : String} {p : s.Pos} {h : p s.startPos} {h' : p.prev h s.startPos} :
                      (p.prev h).prev h' < p
                      theorem String.Pos.Splits.remainingBytes_eq {s : String} {p : s.Pos} {t₁ t₂ : String} (h : p.Splits t₁ t₂) :
                      theorem String.Slice.Pos.Splits.remainingBytes_eq {s : Slice} {p : s.Pos} {t₁ t₂ : String} (h : p.Splits t₁ t₂) :