chore: add grind annotations for List.not_mem_nil (#10493)

This commit is contained in:
Kim Morrison 2025-09-22 22:18:03 +10:00 committed by GitHub
parent b3cd5999e7
commit 979c2b4af0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

View file

@ -371,6 +371,7 @@ abbrev getElem?_mkArray := @getElem?_replicate
/-! ### mem -/
@[grind ←]
theorem not_mem_empty (a : α) : ¬ a ∈ #[] := by simp
@[simp, grind =] theorem mem_push {xs : Array α} {x y : α} : x ∈ xs.push y ↔ x ∈ xs x = y := by

View file

@ -392,7 +392,7 @@ theorem get!_eq_getElem! [Inhabited α] (l : List α) (i) : l.get! i = l[i]! :=
/-! ### mem -/
@[simp] theorem not_mem_nil {a : α} : ¬ a ∈ [] := nofun
@[simp, grind ←] theorem not_mem_nil {a : α} : ¬ a ∈ [] := nofun
@[simp, grind =] theorem mem_cons : a ∈ b :: l ↔ a = b a ∈ l :=
⟨fun h => by cases h <;> simp [Membership.mem, *],

View file

@ -907,6 +907,8 @@ theorem getElem?_singleton {a : α} {i : Nat} : #v[a][i]? = if i = 0 then some a
grind_pattern getElem_mem => xs[i] ∈ xs
@[grind ←]
theorem not_mem_empty (a : α) : ¬ a ∈ #v[] := nofun
@[simp, grind =] theorem mem_push {xs : Vector α n} {x y : α} : x ∈ xs.push y ↔ x ∈ xs x = y := by