Documentation

Init.Data.String.Lemmas.Pattern.TakeDrop.Char

theorem String.Slice.Pos.skip?_char_eq_some_iff {c : Char} {s : Slice} {pos res : s.Pos} :
pos.skip? c = some res ↔ ∃ (h : pos ≠ s.endPos), res = pos.next h ∧ pos.get h = c
@[simp]
theorem String.Slice.Pos.skip?_char_eq_none_iff {c : Char} {s : Slice} {pos : s.Pos} :
pos.skip? c = none ↔ ∀ (h : pos ≠ s.endPos), pos.get h ≠ c
theorem String.Slice.Pos.get_skipWhile_char_ne {c : Char} {s : Slice} {pos : s.Pos} {h : pos.skipWhile c ≠ s.endPos} :
(pos.skipWhile c).get h ≠ c
theorem String.Slice.Pos.skipWhile_char_eq_self_iff_get {c : Char} {s : Slice} {pos : s.Pos} :
pos.skipWhile c = pos ↔ ∀ (h : pos ≠ s.endPos), pos.get h ≠ c
theorem String.Slice.Pos.get_eq_of_lt_skipWhile_char {c : Char} {s : Slice} {pos pos' : s.Pos} (h₁ : pos ≤ pos') (h₂ : pos' < pos.skipWhile c) :
pos'.get ⋯ = c
theorem String.Slice.get_eq_of_lt_skipPrefixWhile_char {c : Char} {s : Slice} {pos : s.Pos} (h : pos < s.skipPrefixWhile c) :
pos.get ⋯ = c
theorem String.Slice.Pos.revSkip?_char_eq_some_iff {c : Char} {s : Slice} {pos res : s.Pos} :
pos.revSkip? c = some res ↔ ∃ (h : pos ≠ s.startPos), res = pos.prev h ∧ (pos.prev h).get ⋯ = c
@[simp]
theorem String.Slice.Pos.revSkip?_char_eq_none_iff {c : Char} {s : Slice} {pos : s.Pos} :
pos.revSkip? c = none ↔ ∀ (h : pos ≠ s.startPos), (pos.prev h).get ⋯ ≠ c
theorem String.Slice.Pos.get_revSkipWhile_char_ne {c : Char} {s : Slice} {pos : s.Pos} {h : pos.revSkipWhile c ≠ s.startPos} :
((pos.revSkipWhile c).prev h).get ⋯ ≠ c
theorem String.Slice.Pos.revSkipWhile_char_eq_self_iff_get {c : Char} {s : Slice} {pos : s.Pos} :
pos.revSkipWhile c = pos ↔ ∀ (h : pos ≠ s.startPos), (pos.prev h).get ⋯ ≠ c
theorem String.Slice.Pos.get_eq_of_revSkipWhile_le_char {c : Char} {s : Slice} {pos pos' : s.Pos} (h₁ : pos' < pos) (h₂ : pos.revSkipWhile c ≤ pos') :
pos'.get ⋯ = c
theorem String.Slice.get_eq_of_skipSuffixWhile_le_char {c : Char} {s : Slice} {pos : s.Pos} (h : s.skipSuffixWhile c ≤ pos) (h' : pos < s.endPos) :
pos.get ⋯ = c
theorem String.skipSuffix?_char_eq_some_iff {c : Char} {s : String} {pos : s.Pos} :
s.skipSuffix? c = some pos ↔ ∃ (h : s.endPos ≠ s.startPos), pos = s.endPos.prev h ∧ (s.endPos.prev h).get ⋯ = c