Skip to content

Commit

Permalink
chore: reduce usage of refine'
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoFX committed Aug 14, 2024
1 parent 5e5e54c commit ff62f39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Batteries/Data/String/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -922,14 +922,14 @@ theorem takeWhile (p : Char → Bool) : ∀ {s}, ValidFor l m r s →
ValidFor l (m.takeWhile p) (m.dropWhile p ++ r) (s.takeWhile p)
| _, ⟨⟩ => by
simp only [Substring.takeWhile, takeWhileAux_of_valid]
refine' .of_eq .. <;> simp
apply ValidFor.of_eq <;> simp
rw [← List.append_assoc, List.takeWhile_append_dropWhile]

theorem dropWhile (p : Char → Bool) : ∀ {s}, ValidFor l m r s →
ValidFor (l ++ m.takeWhile p) (m.dropWhile p) r (s.dropWhile p)
| _, ⟨⟩ => by
simp only [Substring.dropWhile, takeWhileAux_of_valid]
refine' .of_eq .. <;> simp
apply ValidFor.of_eq <;> simp
rw [Nat.add_assoc, ← utf8Len_append (m.takeWhile p), List.takeWhile_append_dropWhile]

-- TODO: takeRightWhile
Expand Down

0 comments on commit ff62f39

Please sign in to comment.