@@ -225,7 +225,7 @@ theorem utf8GetAux_of_valid (cs cs' : List Char) {i p : Nat} (hp : i + utf8Len c
225225 | [], c::cs' => simp [← hp, Pos.Raw.utf8GetAux]
226226 | c::cs, cs' =>
227227 simp only [List.cons_append, Pos.Raw.utf8GetAux, Char.reduceDefault]
228- rw [if_neg ]
228+ rw [ite_eq_right ]
229229 case hnc => simp only [← hp, utf8Len_cons, Pos.Raw.ext_iff]; exact ne_self_add_add_utf8Size
230230 refine utf8GetAux_of_valid cs cs' ?_
231231 simpa [Nat.add_assoc, Nat.add_comm] using hp
@@ -246,7 +246,7 @@ theorem utf8GetAux?_of_valid (cs cs' : List Char) {i p : Nat} (hp : i + utf8Len
246246 | [], c::cs' => simp [← hp, Pos.Raw.utf8GetAux?]
247247 | c::cs, cs' =>
248248 simp only [List.cons_append, Pos.Raw.utf8GetAux?]
249- rw [if_neg ]
249+ rw [ite_eq_right ]
250250 case hnc => simp only [← hp, Pos.Raw.ext_iff]; exact ne_self_add_add_utf8Size
251251 refine utf8GetAux?_of_valid cs cs' ?_
252252 simpa [Nat.add_assoc, Nat.add_comm] using hp
@@ -263,7 +263,7 @@ theorem utf8SetAux_of_valid (c' : Char) (cs cs' : List Char) {i p : Nat} (hp : i
263263 | [], c::cs' => simp [← hp, Pos.Raw.utf8SetAux]
264264 | c::cs, cs' =>
265265 simp only [Pos.Raw.utf8SetAux, List.cons_append]
266- rw [if_neg ]
266+ rw [ite_eq_right ]
267267 case hnc => simp only [← hp, Pos.Raw.ext_iff]; exact ne_self_add_add_utf8Size
268268 refine congrArg (c::·) (utf8SetAux_of_valid c' cs cs' ?_)
269269 simpa [Nat.add_assoc, Nat.add_comm] using hp
@@ -307,7 +307,7 @@ theorem utf8PrevAux_of_valid {cs cs' : List Char} {c : Char} {i p : Nat}
307307 | [] => simp [Pos.Raw.utf8PrevAux, ← hp, Pos.Raw.add_char_eq]
308308 | c'::cs =>
309309 simp only [Pos.Raw.utf8PrevAux, List.cons_append, utf8Len_cons, ← hp]
310- rw [if_neg ]
310+ rw [ite_eq_right ]
311311 case hnc =>
312312 simp only [Pos.Raw.le_iff, Pos.Raw.byteIdx_add_char]
313313 grind [!Char.utf8Size_pos]
@@ -352,7 +352,7 @@ theorem findAux_of_valid (p) : ∀ l m r,
352352 | l, [], r => by unfold Legacy.findAux List.takeWhile; simp
353353 | l, c::m, r => by
354354 unfold Legacy.findAux List.takeWhile
355- rw [dif_pos (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
355+ rw [dite_eq_left (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
356356 have h1 := get_of_valid l (c::m++r); have h2 := next_of_valid l c (m++r)
357357 simp only [List.cons_append, Char.reduceDefault, List.headD_cons] at h1 h2
358358 simp only [List.append_assoc, List.cons_append, h1, utf8Len_cons, h2]
@@ -375,7 +375,7 @@ theorem revFindAux_of_valid (p) : ∀ l r,
375375 | [], r => by unfold Legacy.revFindAux List.dropWhile; simp
376376 | c::l, r => by
377377 unfold Legacy.revFindAux List.dropWhile
378- rw [dif_neg (by exact Pos.Raw.ne_of_gt add_utf8Size_pos)]
378+ rw [dite_eq_right (by exact Pos.Raw.ne_of_gt add_utf8Size_pos)]
379379 have h1 := get_of_valid l.reverse (c::r); have h2 := prev_of_valid l.reverse c r
380380 simp only [utf8Len_reverse, Char.reduceDefault, List.headD_cons] at h1 h2
381381 simp only [List.reverse_cons, List.append_assoc, List.singleton_append,
@@ -396,7 +396,7 @@ theorem firstDiffPos_loop_eq (l₁ l₂ r₁ r₂ stop p)
396396 unfold List.takeWhile₂; split <;> unfold firstDiffPos.loop
397397 · next a r₁ b r₂ =>
398398 rw [
399- dif_pos <| by
399+ dite_eq_left <| by
400400 rw [hstop, ← hl₁, ← hl₂]
401401 refine Nat.lt_min.2 ⟨?_, ?_⟩ <;> exact Nat.lt_add_of_pos_right add_utf8Size_pos,
402402 show Pos.Raw.get (ofList (l₁ ++ a :: r₁)) ⟨p⟩ = a by
@@ -414,7 +414,7 @@ theorem firstDiffPos_loop_eq (l₁ l₂ r₁ r₂ stop p)
414414 (by simp [hl₁]) (by simp [hl₂]) (by simp [hstop, ← Nat.add_assoc, Nat.add_right_comm])
415415 · simp
416416 · next h =>
417- rw [dif_neg ] <;> simp [hstop, ← hl₁, ← hl₂, -Nat.not_lt, Nat.lt_min]
417+ rw [dite_eq_right ] <;> simp [hstop, ← hl₁, ← hl₂, -Nat.not_lt, Nat.lt_min]
418418 intro h₁ h₂
419419 have : ∀ {cs}, 0 < utf8Len cs → cs ≠ [] := by rintro _ h rfl; simp at h
420420 obtain ⟨a, as, e₁⟩ := List.exists_cons_of_ne_nil (this h₁)
@@ -761,7 +761,7 @@ theorem offsetOfPosAux_of_valid : ∀ l m r n,
761761 | l, [], r, n => by unfold String.Pos.Raw.offsetOfPosAux; simp
762762 | l, c::m, r, n => by
763763 unfold String.Pos.Raw.offsetOfPosAux
764- rw [if_neg (by exact Nat.not_le.2 (Nat.lt_add_of_pos_right add_utf8Size_pos))]
764+ rw [ite_eq_right (by exact Nat.not_le.2 (Nat.lt_add_of_pos_right add_utf8Size_pos))]
765765 simp only [List.append_assoc, atEnd_of_valid l (c::m++r)]
766766 simp only [List.cons_append, utf8Len_cons, next_of_valid l c (m ++ r)]
767767 simpa [← Nat.add_assoc, Nat.add_right_comm] using
@@ -777,7 +777,7 @@ theorem foldlAux_of_valid (f : α → Char → α) : ∀ l m r a,
777777 | l, [], r, a => by unfold Legacy.foldlAux; simp
778778 | l, c::m, r, a => by
779779 unfold Legacy.foldlAux
780- rw [dif_pos (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
780+ rw [dite_eq_left (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
781781 simp only [List.append_assoc, List.cons_append, utf8Len_cons, next_of_valid l c (m ++ r),
782782 get_of_valid l (c :: (m ++ r)), Char.reduceDefault, List.headD_cons, List.foldl_cons]
783783 simpa [← Nat.add_assoc, Nat.add_right_comm] using foldlAux_of_valid f (l++[c]) m r (f a c)
@@ -792,7 +792,7 @@ theorem foldrAux_of_valid (f : Char → α → α) (l m r a) :
792792 rw [← m.reverse_reverse]
793793 induction m.reverse generalizing r a with (unfold Legacy.foldrAux; simp)
794794 | cons c m IH =>
795- rw [if_pos add_utf8Size_pos]
795+ rw [ite_eq_left add_utf8Size_pos]
796796 simp only [← Nat.add_assoc, by simpa using prev_of_valid (l ++ m.reverse) c r]
797797 simp only [by simpa using get_of_valid (l ++ m.reverse) (c :: r)]
798798 simpa using IH (c::r) (f c a)
@@ -806,7 +806,7 @@ theorem anyAux_of_valid (p : Char → Bool) : ∀ l m r,
806806 | l, [], r => by unfold Legacy.anyAux; simp
807807 | l, c::m, r => by
808808 unfold Legacy.anyAux
809- rw [dif_pos (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
809+ rw [dite_eq_left (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
810810 simp only [List.append_assoc, List.cons_append, get_of_valid l (c :: (m ++ r)),
811811 Char.reduceDefault, List.headD_cons, utf8Len_cons, next_of_valid l c (m ++ r),
812812 Bool.if_true_left, Bool.decide_eq_true, List.any_cons]
@@ -834,7 +834,7 @@ theorem mapAux_of_valid (f : Char → Char) :
834834 | l, [] => by unfold Legacy.mapAux; simp
835835 | l, c::r => by
836836 unfold Legacy.mapAux
837- rw [dif_neg (by rw [atEnd_of_valid]; simp)]
837+ rw [dite_eq_right (by rw [atEnd_of_valid]; simp)]
838838 simp only [get_of_valid l (c :: r), Char.reduceDefault,
839839 List.headD_cons, set_of_valid l (c :: r), List.modifyHead_cons, next_of_valid l (f c) r,
840840 List.map_cons]
@@ -854,7 +854,7 @@ theorem takeWhileAux_of_valid (p : Char → Bool) : ∀ l m r,
854854 | l, [], r => by unfold Substring.Raw.takeWhileAux List.takeWhile; simp
855855 | l, c::m, r => by
856856 unfold Substring.Raw.takeWhileAux List.takeWhile
857- rw [dif_pos (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
857+ rw [dite_eq_left (by exact Nat.lt_add_of_pos_right add_utf8Size_pos)]
858858 simp only [List.append_assoc, List.cons_append, get_of_valid l (c :: (m ++ r)),
859859 Char.reduceDefault, List.headD_cons, utf8Len_cons, next_of_valid l c (m ++ r)]
860860 cases p c <;> simp
@@ -952,7 +952,7 @@ theorem next : ∀ {s}, ValidFor l (m₁ ++ c :: m₂) r s →
952952 | _, ⟨⟩ => by
953953 simp only [Substring.Raw.next, utf8Len_append, utf8Len_cons, List.append_assoc,
954954 List.cons_append]
955- rw [if_neg (mt Pos.Raw.ext_iff.1 ?a)]
955+ rw [ite_eq_right (mt Pos.Raw.ext_iff.1 ?a)]
956956 case a =>
957957 simpa [Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using
958958 @ne_add_utf8Size_add_self (utf8Len l + utf8Len m₁) (utf8Len m₂) c
@@ -967,7 +967,7 @@ theorem prev : ∀ {s}, ValidFor l (m₁ ++ c :: m₂) r s →
967967 s.prev ⟨utf8Len m₁ + c.utf8Size⟩ = ⟨utf8Len m₁⟩
968968 | _, ⟨⟩ => by
969969 simp only [Substring.Raw.prev, List.append_assoc, List.cons_append]
970- rw [if_neg (mt Pos.Raw.ext_iff.1 <| Ne.symm ?a)]
970+ rw [ite_eq_right (mt Pos.Raw.ext_iff.1 <| Ne.symm ?a)]
971971 case a => simpa [Nat.add_comm] using @ne_add_utf8Size_add_self (utf8Len l) (utf8Len m₁) c
972972 have := prev_of_valid (l ++ m₁) c (m₂ ++ r)
973973 simp only [List.append_assoc, utf8Len_append, Nat.add_assoc,
0 commit comments