Documentation

Init.Data.String.Lemmas.Iterate

@[irreducible]

A list of all positions starting at p.

This function is not meant to be used in actual programs. Actual programs should use Slice.positionsFrom or Slice.positions.

Equations
Instances For
    @[simp]
    theorem String.Slice.Model.map_get_positionsFrom_of_splits {s : Slice} {p : s.Pos} {t₁ t₂ : String} (hp : p.Splits t₁ t₂) :
    List.map (fun (p : { p : s.Pos // p ≠ s.endPos }) => p.val.get ⋯) (Model.positionsFrom p) = t₂.toList
    theorem String.Slice.Pos.Splits.mem_toList_left_iff {s : Slice} {pos : s.Pos} {t u : String} {c : Char} (hs : pos.Splits t u) :
    c ∈ t.toList ↔ ∃ (pos' : s.Pos), ∃ (h : pos' < pos), pos'.get ⋯ = c
    theorem String.Slice.Pos.Splits.mem_toList_right_iff {s : Slice} {pos : s.Pos} {t u : String} {c : Char} (hs : pos.Splits t u) :
    c ∈ u.toList ↔ ∃ (pos' : s.Pos), ∃ (x : pos ≤ pos'), ∃ (h : pos' ≠ s.endPos), pos'.get h = c
    @[irreducible]

    A list of all positions strictly before p, ordered from largest to smallest.

    This function is not meant to be used in actual programs. Actual programs should use Slice.revPositionsFrom and Slice.revPositions.

    Equations
    Instances For
      theorem String.Slice.Model.map_get_revPositionsFrom_of_splits {s : Slice} {p : s.Pos} {t₁ t₂ : String} (hp : p.Splits t₁ t₂) :
      List.map (fun (p : { p : s.Pos // p ≠ s.endPos }) => p.val.get ⋯) (Model.revPositionsFrom p) = t₁.toList.reverse
      theorem String.Slice.forIn_eq_forIn_chars {β : Type u} {m : Type u → Type v} [Monad m] {s : Slice} {b : β} {f : Char → β → m (ForInStep β)} :
      forIn s b f = forIn s.chars b f
      @[simp]
      theorem String.Slice.forIn_eq_forIn_toList {β : Type u} {m : Type u → Type v} [Monad m] [LawfulMonad m] {s : Slice} {b : β} {f : Char → β → m (ForInStep β)} :
      forIn s b f = forIn s.copy.toList b f
      @[simp]
      theorem String.Slice.foldl_eq_foldl_toList {α : Type u} {f : α → Char → α} {init : α} {s : Slice} :
      foldl f init s = List.foldl f init s.copy.toList
      @[simp]
      theorem String.Slice.foldr_eq_foldr_toList {α : Type u} {f : Char → α → α} {init : α} {s : Slice} :
      foldr f init s = List.foldr f init s.copy.toList
      @[irreducible]

      A list of all positions starting at p.

      This function is not meant to be used in actual programs. Actual programs should use String.positionsFrom or String.positions.

      Equations
      Instances For
        @[simp]
        theorem String.Model.mem_positionsFrom {s : String} {p : s.Pos} {q : { q : s.Pos // q ≠ s.endPos }} :
        theorem String.Model.map_get_positionsFrom_of_splits {s : String} {p : s.Pos} {t₁ t₂ : String} (hp : p.Splits t₁ t₂) :
        List.map (fun (p : { p : s.Pos // p ≠ s.endPos }) => p.val.get ⋯) (Model.positionsFrom p) = t₂.toList
        theorem String.Pos.Splits.mem_toList_left_iff {s : String} {pos : s.Pos} {t u : String} {c : Char} (hs : pos.Splits t u) :
        c ∈ t.toList ↔ ∃ (pos' : s.Pos), ∃ (h : pos' < pos), pos'.get ⋯ = c
        theorem String.Pos.Splits.mem_toList_right_iff {s : String} {pos : s.Pos} {t u : String} {c : Char} (hs : pos.Splits t u) :
        c ∈ u.toList ↔ ∃ (pos' : s.Pos), ∃ (x : pos ≤ pos'), ∃ (h : pos' ≠ s.endPos), pos'.get h = c
        @[irreducible]

        A list of all positions strictly before p, ordered from largest to smallest.

        This function is not meant to be used in actual programs. Actual programs should use String.revPositionsFrom and String.revPositions.

        Equations
        Instances For
          theorem String.Model.map_get_revPositionsFrom_of_splits {s : String} {p : s.Pos} {t₁ t₂ : String} (hp : p.Splits t₁ t₂) :
          List.map (fun (p : { p : s.Pos // p ≠ s.endPos }) => p.val.get ⋯) (Model.revPositionsFrom p) = t₁.toList.reverse
          theorem String.forIn_eq_forIn_chars {β : Type u} {m : Type u → Type v} [Monad m] {s : String} {b : β} {f : Char → β → m (ForInStep β)} :
          forIn s b f = forIn s.chars b f
          @[simp]
          theorem String.forIn_eq_forIn_toList {β : Type u} {m : Type u → Type v} [Monad m] [LawfulMonad m] {s : String} {b : β} {f : Char → β → m (ForInStep β)} :
          forIn s b f = forIn s.toList b f
          @[simp]
          theorem String.foldl_eq_foldl_toList {α : Type u} {f : α → Char → α} {init : α} {s : String} :
          foldl f init s = List.foldl f init s.toList
          @[simp]
          theorem String.foldr_eq_foldr_toList {α : Type u} {f : Char → α → α} {init : α} {s : String} :
          foldr f init s = List.foldr f init s.toList