Documentation

Init.Data.String.Lemmas.Pattern.String.Basic

@[implicit_reducible]
Equations
theorem String.Slice.Pattern.Model.ForwardSliceSearcher.isLongestMatchAt_iff {pat s : Slice} {pos₁ pos₂ : s.Pos} (h : pat.isEmpty = false) :
IsLongestMatchAt pat pos₁ pos₂ ↔ ∃ (h : pos₁ ≤ pos₂), (s.slice pos₁ pos₂ h).copy = pat.copy
theorem String.Slice.Pattern.Model.ForwardSliceSearcher.isLongestRevMatchAt_iff {pat s : Slice} {pos₁ pos₂ : s.Pos} (h : pat.isEmpty = false) :
IsLongestRevMatchAt pat pos₁ pos₂ ↔ ∃ (h : pos₁ ≤ pos₂), (s.slice pos₁ pos₂ h).copy = pat.copy
theorem String.Slice.Pattern.Model.ForwardSliceSearcher.isLongestMatchAt_iff_splits {pat s : Slice} {pos₁ pos₂ : s.Pos} (h : pat.isEmpty = false) :
IsLongestMatchAt pat pos₁ pos₂ ↔ ∃ (t₁ : String), ∃ (t₂ : String), pos₁.Splits t₁ (pat.copy ++ t₂) ∧ pos₂.Splits (t₁ ++ pat.copy) t₂
theorem String.Slice.Pattern.Model.ForwardSliceSearcher.isLongestRevMatchAt_iff_splits {pat s : Slice} {pos₁ pos₂ : s.Pos} (h : pat.isEmpty = false) :
IsLongestRevMatchAt pat pos₁ pos₂ ↔ ∃ (t₁ : String), ∃ (t₂ : String), pos₁.Splits t₁ (pat.copy ++ t₂) ∧ pos₂.Splits (t₁ ++ pat.copy) t₂
theorem String.Slice.Pattern.Model.ForwardSliceSearcher.offset_of_isLongestMatchAt {pat s : Slice} {pos₁ pos₂ : s.Pos} (h : pat.isEmpty = false) (h' : IsLongestMatchAt pat pos₁ pos₂) :
@[implicit_reducible]
Equations
theorem String.Slice.Pattern.Model.ForwardStringSearcher.isMatch_iff {pat : String} {s : Slice} {pos : s.Pos} (h : pat ≠ "") :
IsMatch pat pos ↔ (s.sliceTo pos).copy = pat
theorem String.Slice.Pattern.Model.ForwardStringSearcher.isLongestMatchAt_iff {pat : String} {s : Slice} {pos₁ pos₂ : s.Pos} (h : pat ≠ "") :
IsLongestMatchAt pat pos₁ pos₂ ↔ ∃ (h : pos₁ ≤ pos₂), (s.slice pos₁ pos₂ h).copy = pat
theorem String.Slice.Pattern.Model.ForwardStringSearcher.isLongestRevMatchAt_iff {pat : String} {s : Slice} {pos₁ pos₂ : s.Pos} (h : pat ≠ "") :
IsLongestRevMatchAt pat pos₁ pos₂ ↔ ∃ (h : pos₁ ≤ pos₂), (s.slice pos₁ pos₂ h).copy = pat
theorem String.Slice.Pattern.Model.ForwardStringSearcher.isLongestMatchAt_iff_splits {pat : String} {s : Slice} {pos₁ pos₂ : s.Pos} (h : pat ≠ "") :
IsLongestMatchAt pat pos₁ pos₂ ↔ ∃ (t₁ : String), ∃ (t₂ : String), pos₁.Splits t₁ (pat ++ t₂) ∧ pos₂.Splits (t₁ ++ pat) t₂
theorem String.Slice.Pattern.Model.ForwardStringSearcher.isLongestRevMatchAt_iff_splits {pat : String} {s : Slice} {pos₁ pos₂ : s.Pos} (h : pat ≠ "") :
IsLongestRevMatchAt pat pos₁ pos₂ ↔ ∃ (t₁ : String), ∃ (t₂ : String), pos₁.Splits t₁ (pat ++ t₂) ∧ pos₂.Splits (t₁ ++ pat) t₂
theorem String.Slice.Pattern.Model.ForwardStringSearcher.offset_of_isLongestMatchAt {pat : String} {s : Slice} {pos₁ pos₂ : s.Pos} (h : pat ≠ "") (h' : IsLongestMatchAt pat pos₁ pos₂) :
theorem String.Slice.Pattern.Model.ForwardStringSearcher.offset_of_isLongestRevMatchAt {pat : String} {s : Slice} {pos₁ pos₂ : s.Pos} (h : pat ≠ "") (h' : IsLongestRevMatchAt pat pos₁ pos₂) :
theorem String.Slice.Pattern.Model.ForwardStringSearcher.matchesAt_iff_splits {pat : String} {s : Slice} {pos : s.Pos} (h : pat ≠ "") :
MatchesAt pat pos ↔ ∃ (t₁ : String), ∃ (t₂ : String), pos.Splits t₁ (pat ++ t₂)
theorem String.Slice.Pattern.Model.ForwardStringSearcher.revMatchesAt_iff_splits {pat : String} {s : Slice} {pos : s.Pos} (h : pat ≠ "") :
RevMatchesAt pat pos ↔ ∃ (t₁ : String), ∃ (t₂ : String), pos.Splits (t₁ ++ pat) t₂