Documentation

Mathlib.Data.String.Basic

Strings #

Supplementary theorems about the String type.

@[irreducible]
def String.ltb (s₁ s₂ : Iterator) :

< on string iterators. This coincides with < on strings as lists.

Equations
Instances For
    instance String.LT' :

    This overrides an instance in core Lean.

    Equations

    This instance has a prime to avoid the name of the corresponding instance in core Lean.

    Equations
    @[irreducible]
    def String.ltb.inductionOn {motive : IteratorIteratorSort u} (it₁ it₂ : Iterator) (ind : (s₁ s₂ : String) → (i₁ i₂ : Pos.Raw) → { s := s₂, i := i₂ }.hasNext = true{ s := s₁, i := i₁ }.hasNext = truePos.Raw.get s₁ i₁ = Pos.Raw.get s₂ i₂motive { s := s₁, i := i₁ }.next { s := s₂, i := i₂ }.nextmotive { s := s₁, i := i₁ } { s := s₂, i := i₂ }) (eq : (s₁ s₂ : String) → (i₁ i₂ : Pos.Raw) → { s := s₂, i := i₂ }.hasNext = true{ s := s₁, i := i₁ }.hasNext = true¬Pos.Raw.get s₁ i₁ = Pos.Raw.get s₂ i₂motive { s := s₁, i := i₁ } { s := s₂, i := i₂ }) (base₁ : (s₁ s₂ : String) → (i₁ i₂ : Pos.Raw) → { s := s₂, i := i₂ }.hasNext = true¬{ s := s₁, i := i₁ }.hasNext = truemotive { s := s₁, i := i₁ } { s := s₂, i := i₂ }) (base₂ : (s₁ s₂ : String) → (i₁ i₂ : Pos.Raw) → ¬{ s := s₂, i := i₂ }.hasNext = truemotive { s := s₁, i := i₁ } { s := s₂, i := i₂ }) :
    motive it₁ it₂

    Induction on String.ltb.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem String.ltb_cons_addChar' (c : Char) (s₁ s₂ : Iterator) :
      ltb { s := mk (c :: s₁.s.data), i := s₁.i + c } { s := mk (c :: s₂.s.data), i := s₂.i + c } = ltb s₁ s₂
      theorem String.ltb_cons_addChar (c : Char) (cs₁ cs₂ : List Char) (i₁ i₂ : Pos.Raw) :
      ltb { s := mk (c :: cs₁), i := i₁ + c } { s := mk (c :: cs₂), i := i₂ + c } = ltb { s := mk cs₁, i := i₁ } { s := mk cs₂, i := i₂ }
      @[simp]
      theorem String.lt_iff_toList_lt {s₁ s₂ : String} :
      s₁ < s₂ s₁.toList < s₂.toList
      Equations
      @[simp]
      theorem String.le_iff_toList_le {s₁ s₂ : String} :
      s₁ s₂ s₁.toList s₂.toList
      theorem String.toList_inj {s₁ s₂ : String} :
      s₁.toList = s₂.toList s₁ = s₂
      theorem String.toList_nonempty {s : String} :
      s ""s.toList = s.head :: (s.drop 1).toList
      Equations
      • One or more equations did not get rendered due to their size.
      theorem List.asString_eq {l : List Char} {s : String} :