Skip to content

Commit afc5aed

Browse files
committed
chore: fix deprecations
1 parent 29cf988 commit afc5aed

14 files changed

Lines changed: 53 additions & 53 deletions

File tree

Batteries/Classes/Order.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ theorem LawfulLTCmp.eq_compareOfLessAndEq
164164
theorem ReflCmp.compareOfLessAndEq_of_lt_irrefl [LT α] [DecidableLT α] [DecidableEq α]
165165
(lt_irrefl : ∀ x : α, ¬ x < x) :
166166
ReflCmp (α := α) (compareOfLessAndEq · ·) where
167-
compare_self {x} := by simp [compareOfLessAndEq, if_neg (lt_irrefl x)]
167+
compare_self {x} := by simp [compareOfLessAndEq, ite_eq_right (lt_irrefl x)]
168168

169169
theorem LawfulBEqCmp.compareOfLessAndEq_of_lt_irrefl
170170
[LT α] [DecidableLT α] [DecidableEq α] [BEq α] [LawfulBEq α]

Batteries/Data/Char/AsciiCasing.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ theorem toLower_eq_of_isUpper {c : Char} (h : c.isUpper) : c.toLower = ofNat (c.
3939

4040
theorem toUpper_eq_of_not_isLower {c : Char} (h : ¬ c.isLower) : c.toUpper = c := by
4141
simp only [isLower, Bool.and_eq_true, decide_eq_true_eq] at h
42-
simp only [toUpper, dif_neg h]
42+
simp only [toUpper, dite_eq_right h]
4343

4444
theorem toUpper_eq_of_isLower {c : Char} (h : c.isLower) : c.toUpper = ofNat (c.toNat - 32) := by
4545
ext
@@ -103,7 +103,7 @@ theorem toUpper_eq_of_isLower {c : Char} (h : c.isLower) : c.toUpper = ofNat (c.
103103
Bool.decide_and, not_and, Nat.not_le] at hl hu
104104
omega
105105
rw [toLower_eq_of_isUpper hu', toUpper_eq_of_isLower hl, toLower_eq_of_not_isUpper hu,
106-
toNat_ofNat, if_pos hv, Nat.sub_add_cancel h, ofNat_toNat]
106+
toNat_ofNat, ite_eq_left hv, Nat.sub_add_cancel h, ofNat_toNat]
107107
· rw [toUpper_eq_of_not_isLower hl]
108108

109109
@[simp] theorem toUpper_toUpper_eq_toUpper (c : Char) : c.toUpper.toUpper = c.toUpper := by
@@ -119,7 +119,7 @@ theorem toUpper_eq_of_isLower {c : Char} (h : c.isLower) : c.toUpper = ofNat (c.
119119
isLower, not_and, Nat.not_le] at hu hl
120120
omega
121121
rw [toUpper_eq_of_isLower hl', toLower_eq_of_isUpper hu, toUpper_eq_of_not_isLower hl,
122-
toNat_ofNat, if_pos hv, Nat.add_sub_cancel, ofNat_toNat]
122+
toNat_ofNat, ite_eq_left hv, Nat.add_sub_cancel, ofNat_toNat]
123123
· rw [toLower_eq_of_not_isUpper hu]
124124

125125
/-- Case folding for ASCII characters only.

Batteries/Data/Char/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private theorem of_all_eq_true_aux (h : Char.all p) (n : Nat) (hn : n.isValidCha
8989

9090
theorem eq_true_of_all_eq_true (h : Char.all p) (c : Char) : p c := by
9191
have : c.toNat.isValidChar := c.valid
92-
rw [← c.ofNat_toNat, ofNat, dif_pos this]
92+
rw [← c.ofNat_toNat, ofNat, dite_eq_left this]
9393
exact of_all_eq_true_aux h c.toNat this
9494

9595
theorem exists_eq_false_of_all_eq_false (h : Char.all p = false) :
@@ -135,7 +135,7 @@ private theorem of_any_eq_false_aux (h : Char.any p = false) (n : Nat) (hn : n.i
135135

136136
theorem eq_false_of_any_eq_false (h : Char.any p = false) (c : Char) : p c = false := by
137137
have : c.toNat.isValidChar := c.valid
138-
rw [← c.ofNat_toNat, ofNat, dif_pos this]
138+
rw [← c.ofNat_toNat, ofNat, dite_eq_left this]
139139
exact of_any_eq_false_aux h c.toNat this
140140

141141
theorem any_eq_true_iff_exists_eq_true : Char.any p = true ↔ ∃ c, p c = true := by

Batteries/Data/Fin/Coding.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def encodeSigma (f : Fin n → Nat) (x : (i : Fin n) × Fin (f i)) : Fin (Fin.su
240240
· contradiction
241241
| ⟨⟨i+1, hi⟩, ⟨x, hx⟩⟩ =>
242242
have : ¬ encodeSigma f ⟨⟨i+1, hi⟩, ⟨x, hx⟩⟩ < f 0 := by simp [encodeSigma]
243-
rw [dif_neg this]
243+
rw [dite_eq_right this]
244244
have : (encodeSigma f ⟨⟨i+1, hi⟩, ⟨x, hx⟩⟩).1 - f 0 =
245245
(encodeSigma (f ·.succ) ⟨⟨i, Nat.lt_of_succ_lt_succ hi⟩, ⟨x, hx⟩⟩).1 := by
246246
simp [encodeSigma, Nat.add_sub_cancel_left]
@@ -417,7 +417,7 @@ theorem encodeSubtype_succ_neg {P : Fin (n+1) → Prop} [DecidablePred P] (h₀
417417
| zero => absurd x.val.is_lt; simp
418418
| succ n ih =>
419419
if h₀ : P 0 then
420-
simp only [decodeSubtype, dif_pos h₀]
420+
simp only [decodeSubtype, dite_eq_left h₀]
421421
cases i using Fin.cases with
422422
| zero => rw [encodeSubtype_zero_pos h₀]
423423
| succ i =>
@@ -426,7 +426,7 @@ theorem encodeSubtype_succ_neg {P : Fin (n+1) → Prop} [DecidablePred P] (h₀
426426
congr
427427
rw [ih (fun i => P i.succ) ⟨i, h⟩]
428428
else
429-
simp only [decodeSubtype, dif_neg h₀]
429+
simp only [decodeSubtype, dite_eq_right h₀]
430430
cases i using Fin.cases with
431431
| zero => contradiction
432432
| succ i =>

Batteries/Data/Fin/Fold.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ theorem dfoldr_eq_foldr (f : (i : Fin n) → α → α) (x) :
7676
theorem dfoldlM_loop_lt [Monad m] (f : ∀ (i : Fin n), α i.castSucc → m (α i.succ)) (h : i < n) (x) :
7777
dfoldlM.loop n α f i (Nat.lt_add_right 1 h) x =
7878
(f ⟨i, h⟩ x) >>= (dfoldlM.loop n α f (i+1) (Nat.add_lt_add_right h 1)) := by
79-
rw [dfoldlM.loop, dif_pos h]
79+
rw [dfoldlM.loop, dite_eq_left h]
8080

8181
theorem dfoldlM_loop_eq [Monad m] (f : ∀ (i : Fin n), α i.castSucc → m (α i.succ)) (x) :
8282
dfoldlM.loop n α f n (Nat.le_refl _) x = pure x := by
83-
rw [dfoldlM.loop, dif_neg (Nat.lt_irrefl _)]; rfl
83+
rw [dfoldlM.loop, dite_eq_right (Nat.lt_irrefl _)]; rfl
8484

8585
set_option backward.isDefEq.respectTransparency false in
8686
@[simp] theorem dfoldlM_zero [Monad m] (f : (i : Fin 0) → α i.castSucc → m (α i.succ)) (x) :

Batteries/Data/Fin/Lemmas.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ theorem find?_one {p : Fin 1 → Bool} : find? p = if p 0 then some 0 else none
285285
theorem find?_succ {p : Fin (n+1) → Bool} :
286286
find? p = if p 0 then some 0 else (find? (p ·.succ)).map Fin.succ := by
287287
simp only [findSome?_succ, Option.guard, fun a => apply_ite (Option.or · a),
288-
Option.some_or, Option.none_or, map_findSome?, Option.map_if]
288+
Option.some_or, Option.none_or, map_findSome?, Option.map_ite]
289289

290290
@[grind =]
291291
theorem find?_eq_some_iff {p : Fin n → Bool} :
@@ -356,7 +356,7 @@ theorem findRev?_succ {p : Fin (n+1) → Bool} :
356356
findRev? p = if p (last n) then some (last n)
357357
else (findRev? fun i => p i.castSucc).map Fin.castSucc := by
358358
simp only [findSomeRev?_succ, Option.guard, fun a => apply_ite (Option.or · a),
359-
Option.some_or, Option.none_or, map_findSomeRev?, Option.map_if]
359+
Option.some_or, Option.none_or, map_findSomeRev?, Option.map_ite]
360360

361361
theorem findRev?_one {p : Fin 1 → Bool} : findRev? p = if p 0 then some 0 else none := by
362362
grind [findRev?_succ]

Batteries/Data/Float/Lemmas.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ theorem pack_unpack {spec : Format} (b : BitVec spec.numBits) :
7979
unfold pack
8080
extract_lets mantbits biasedexp
8181
simp only [BitVec.ofNat_toNat, BitVec.setWidth_eq, mvec]
82-
rw [if_neg, if_neg]
82+
rw [ite_eq_right, ite_eq_right]
8383
· rw [Format.mantissaBits, Nat.add_comm, Nat.add_left_cancel_iff]
8484
apply Nat.ne_of_lt
8585
have := mt BitVec.toNat_inj.mp hmvec
@@ -95,7 +95,7 @@ theorem pack_unpack {spec : Format} (b : BitVec spec.numBits) :
9595
false_and, decide_false, Bool.false_eq_true, ↓reduceIte, evec]
9696
unfold pack
9797
extract_lets mantbits biasedexp
98-
rw [if_neg, if_pos]
98+
rw [ite_eq_right, ite_eq_left]
9999
· congr 1
100100
· simp +arith [biasedexp, e, evec]
101101
· rw [BitVec.ofNat_toNat, BitVec.setWidth_append]

Batteries/Data/List/Lemmas.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ theorem cons_diff (a : α) (l₁ l₂ : List α) :
302302
simp[*]
303303

304304
theorem cons_diff_of_mem {a : α} {l₂ : List α} (h : a ∈ l₂) (l₁ : List α) :
305-
(a :: l₁).diff l₂ = l₁.diff (l₂.erase a) := by rw [cons_diff, if_pos h]
305+
(a :: l₁).diff l₂ = l₁.diff (l₂.erase a) := by rw [cons_diff, ite_eq_left h]
306306

307307
theorem cons_diff_of_not_mem {a : α} {l₂ : List α} (h : a ∉ l₂) (l₁ : List α) :
308-
(a :: l₁).diff l₂ = a :: l₁.diff l₂ := by rw [cons_diff, if_neg h]
308+
(a :: l₁).diff l₂ = a :: l₁.diff l₂ := by rw [cons_diff, ite_eq_right h]
309309

310310
theorem diff_eq_foldl : ∀ l₁ l₂ : List α, l₁.diff l₂ = foldl List.erase l₁ l₂
311311
| _, [] => rfl

Batteries/Data/List/Pairwise.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ theorem pairwise_iff_get : Pairwise R l ↔ ∀ (i j) (_hij : i < j), R (get l i
4646
@[simp] theorem pwFilter_nil [DecidableRel R] : pwFilter R [] = [] := rfl
4747

4848
@[simp] theorem pwFilter_cons_of_pos [DecidableRel (α := α) R] {a : α} {l : List α}
49-
(h : ∀ b ∈ pwFilter R l, R a b) : pwFilter R (a :: l) = a :: pwFilter R l := if_pos h
49+
(h : ∀ b ∈ pwFilter R l, R a b) : pwFilter R (a :: l) = a :: pwFilter R l := ite_eq_left h
5050

5151
@[simp] theorem pwFilter_cons_of_neg [DecidableRel (α := α) R] {a : α} {l : List α}
52-
(h : ¬∀ b ∈ pwFilter R l, R a b) : pwFilter R (a :: l) = pwFilter R l := if_neg h
52+
(h : ¬∀ b ∈ pwFilter R l, R a b) : pwFilter R (a :: l) = pwFilter R l := ite_eq_right h
5353

5454
theorem pwFilter_map [DecidableRel (α := α) R] (f : β → α) :
5555
∀ l : List β, pwFilter R (map f l) = map f (pwFilter (fun x y => R (f x) (f y)) l)

Batteries/Data/String/Lemmas.lean

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)