File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -224,22 +224,20 @@ theorem utf8PrevAux_of_valid {cs cs' : List Char} {c : Char} {i p : Nat}
224224 simp only [utf8PrevAux, List.cons_append, utf8Len_cons, ← hp]
225225 rw [if_neg]
226226 case hnc =>
227- simp only [Pos.ext_iff]
228- rw [Nat.add_right_comm, Nat.add_left_comm]
229- apply ne_add_utf8Size_add_self
227+ simp only [Pos.le_iff, pos_add_char]
228+ grind [Char.utf8Size_pos]
230229 refine (utf8PrevAux_of_valid (by simp [Nat.add_assoc, Nat.add_left_comm])).trans ?_
231230 simp [Nat.add_assoc, Nat.add_comm]
232231
233232theorem prev_of_valid (cs : List Char) (c : Char) (cs' : List Char) :
234233 prev ⟨cs ++ c :: cs'⟩ ⟨utf8Len cs + c.utf8Size⟩ = ⟨utf8Len cs⟩ := by
235234 simp only [prev]
236- refine (if_neg (Pos.ne_of_gt add_utf8Size_pos)).trans ?_
237235 rw [utf8PrevAux_of_valid] <;> simp
238236
239237theorem prev_of_valid' (cs cs' : List Char) :
240238 prev ⟨cs ++ cs'⟩ ⟨utf8Len cs⟩ = ⟨utf8Len cs.dropLast⟩ := by
241239 match cs, cs.eq_nil_or_concat with
242- | _, .inl rfl => rfl
240+ | _, .inl rfl => apply prev_zero
243241 | _, .inr ⟨cs, c, rfl⟩ => simp [prev_of_valid]
244242
245243theorem front_eq (s : String) : front s = s.1 .headD default := by
You can’t perform that action at this time.
0 commit comments