chore: don't use simp_arith when simp will do (#5256)

This commit is contained in:
Kim Morrison 2024-09-04 17:56:25 +10:00 committed by GitHub
parent a926d0ced0
commit 05fe436bda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 10 deletions

View file

@ -38,7 +38,7 @@ private theorem List.of_toArrayAux_eq_toArrayAux {as bs : List α} {cs ds : Arra
· intro h; rw [h]
def Array.mapM' [Monad m] (f : α → m β) (as : Array α) : m { bs : Array β // bs.size = as.size } :=
go 0 ⟨mkEmpty as.size, rfl⟩ (by simp_arith)
go 0 ⟨mkEmpty as.size, rfl⟩ (by simp)
where
go (i : Nat) (acc : { bs : Array β // bs.size = i }) (hle : i ≤ as.size) : m { bs : Array β // bs.size = as.size } := do
if h : i = as.size then

View file

@ -167,8 +167,8 @@ theorem getElem_append_right (as bs : List α) (h : ¬ i < as.length) {h' h''} :
induction as generalizing i with
| nil => trivial
| cons a as ih =>
cases i with simp [get, Nat.succ_sub_succ] <;> simp_arith [Nat.succ_sub_succ] at h
| succ i => apply ih; simp_arith [h]
cases i with simp [get, Nat.succ_sub_succ] <;> simp [Nat.succ_sub_succ] at h
| succ i => apply ih; simp [h]
theorem get_last {as : List α} {i : Fin (length (as ++ [a]))} (h : ¬ i.1 < as.length) : (as ++ [a] : List _).get i = a := by
cases i; rename_i i h'
@ -177,8 +177,8 @@ theorem get_last {as : List α} {i : Fin (length (as ++ [a]))} (h : ¬ i.1 < as.
| zero => simp [List.get]
| succ => simp_arith at h'
| cons a as ih =>
cases i with simp_arith at h
| succ i => apply ih; simp_arith [h]
cases i with simp at h
| succ i => apply ih; simp [h]
theorem sizeOf_lt_of_mem [SizeOf α] {as : List α} (h : a ∈ as) : sizeOf a < sizeOf as := by
induction h with

View file

@ -14,8 +14,8 @@ theorem log2_terminates : ∀ n, n ≥ 2 → n / 2 < n
| n+4, _ => by
rw [div_eq, if_pos]
refine succ_lt_succ (Nat.lt_trans ?_ (lt_succ_self _))
exact log2_terminates (n+2) (by simp_arith)
simp_arith
exact log2_terminates (n+2) (by simp)
simp
/--
Computes `⌊max 0 (log₂ n)⌋`.

View file

@ -30,4 +30,4 @@ import Init.Data.Nat.Linear
cases a; simp_arith [Char.toNat]
@[simp] protected theorem Subtype.sizeOf {α : Sort u_1} {p : α → Prop} (s : Subtype p) : sizeOf s = sizeOf s.val + 1 := by
cases s; simp_arith
cases s; simp

View file

@ -150,8 +150,8 @@ partial def lcs (left right : Subarray α) : Array α := Id.run do
let some (_, v, li, ri) := best
| return pref ++ suff
let lefts := left.split ⟨li.val, by cases li; simp_arith; omega⟩
let rights := right.split ⟨ri.val, by cases ri; simp_arith; omega⟩
let lefts := left.split ⟨li.val, by cases li; omega⟩
let rights := right.split ⟨ri.val, by cases ri; omega⟩
pref ++ lcs lefts.1 rights.1 ++ #[v] ++ lcs (lefts.2.drop 1) (rights.2.drop 1) ++ suff