Skip to content

Commit f3d1653

Browse files
committed
chore: fixes for the simpNF linter
1 parent 2a1354b commit f3d1653

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/Init/Data/Array/Attach.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,12 @@ state, the right approach is usually the tactic `simp [Array.unattach, -Array.ma
574574
-/
575575
def unattach {α : Type _} {p : α → Prop} (xs : Array { x // p x }) : Array α := xs.map (·.val)
576576

577-
@[simp] theorem unattach_nil {p : α → Prop} : (#[] : Array { x // p x }).unattach = #[] := by
577+
@[simp] theorem unattach_empty {p : α → Prop} : (#[] : Array { x // p x }).unattach = #[] := by
578578
simp [unattach]
579579

580+
@[deprecated unattach_empty (since := "2025-05-26")]
581+
abbrev unattach_nil := @unattach_empty
582+
580583
@[simp] theorem unattach_push {p : α → Prop} {a : { x // p x }} {xs : Array { x // p x }} :
581584
(xs.push a).unattach = xs.unattach.push a.1 := by
582585
simp only [unattach, Array.map_push]

src/Init/Data/Array/Bootstrap.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ theorem foldrM_eq_reverse_foldlM_toList [Monad m] {f : α → β → m β} {init
8989
xs.toList.foldr f init = xs.foldr f init :=
9090
List.foldr_eq_foldrM .. ▸ foldrM_toList ..
9191

92-
@[simp, grind =] theorem push_toList {xs : Array α} {a : α} : (xs.push a).toList = xs.toList ++ [a] := by
92+
@[simp, grind =] theorem toList_push {xs : Array α} {x : α} : (xs.push x).toList = xs.toList ++ [x] := by
93+
rcases xs with ⟨xs⟩
9394
simp [push, List.concat_eq_append]
9495

96+
@[deprecated toList_push (since := "2025-05-26")]
97+
abbrev push_toList := @toList_push
98+
9599
@[simp, grind =] theorem toListAppend_eq {xs : Array α} {l : List α} : xs.toListAppend l = xs.toList ++ l := by
96100
simp [toListAppend, ← foldr_toList]
97101

src/Init/Data/Array/Lemmas.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4425,7 +4425,8 @@ theorem getElem!_eq_getD [Inhabited α] {xs : Array α} {i} : xs[i]! = xs.getD i
44254425

44264426
/-! # mem -/
44274427

4428-
@[simp, grind =] theorem mem_toList {a : α} {xs : Array α} : a ∈ xs.toList ↔ a ∈ xs := mem_def.symm
4428+
@[deprecated mem_toList_iff (since := "2025-05-26")]
4429+
theorem mem_toList {a : α} {xs : Array α} : a ∈ xs.toList ↔ a ∈ xs := mem_def.symm
44294430

44304431
@[deprecated not_mem_empty (since := "2025-03-25")]
44314432
theorem not_mem_nil (a : α) : ¬ a ∈ #[] := nofun
@@ -4474,7 +4475,7 @@ theorem getElem?_push_eq {xs : Array α} {x : α} : (xs.push x)[xs.size]? = some
44744475
simp
44754476

44764477
@[simp, grind =] theorem forIn'_toList [Monad m] {xs : Array α} {b : β} {f : (a : α) → a ∈ xs.toList → β → m (ForInStep β)} :
4477-
forIn' xs.toList b f = forIn' xs b (fun a m b => f a (mem_toList.mpr m) b) := by
4478+
forIn' xs.toList b f = forIn' xs b (fun a m b => f a (mem_toList_iff.mpr m) b) := by
44784479
cases xs
44794480
simp
44804481

0 commit comments

Comments
 (0)