Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Init/Data/Array/BasicAux.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Init/Data/List/BasicAux.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Init/Data/Nat/Log2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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)⌋`.
Expand Down
2 changes: 1 addition & 1 deletion src/Init/SizeOfLemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/Lean/Util/Diff.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading