From 979c2b4af0f0c052d3a42af2473c22e785279917 Mon Sep 17 00:00:00 2001 From: Kim Morrison <477956+kim-em@users.noreply.github.com> Date: Mon, 22 Sep 2025 22:18:03 +1000 Subject: [PATCH] chore: add grind annotations for List.not_mem_nil (#10493) --- src/Init/Data/Array/Lemmas.lean | 1 + src/Init/Data/List/Lemmas.lean | 2 +- src/Init/Data/Vector/Lemmas.lean | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Init/Data/Array/Lemmas.lean b/src/Init/Data/Array/Lemmas.lean index 2b2ffe7f3c..008adc76e8 100644 --- a/src/Init/Data/Array/Lemmas.lean +++ b/src/Init/Data/Array/Lemmas.lean @@ -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 diff --git a/src/Init/Data/List/Lemmas.lean b/src/Init/Data/List/Lemmas.lean index 14c37995ec..4dbba13f0f 100644 --- a/src/Init/Data/List/Lemmas.lean +++ b/src/Init/Data/List/Lemmas.lean @@ -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, *], diff --git a/src/Init/Data/Vector/Lemmas.lean b/src/Init/Data/Vector/Lemmas.lean index c62105f30d..0d91601b80 100644 --- a/src/Init/Data/Vector/Lemmas.lean +++ b/src/Init/Data/Vector/Lemmas.lean @@ -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