Compare commits

...

1 Commits

Author SHA1 Message Date
Kim Morrison
4a981a4af6 chore: add @[grind] to List/Array/Vector.mem_map 2025-06-03 14:46:03 +10:00
3 changed files with 6 additions and 3 deletions

View File

@@ -1260,7 +1260,8 @@ theorem map_singleton {f : α → β} {a : α} : map f #[a] = #[f a] := by simp
-- We use a lower priority here as there are more specific lemmas in downstream libraries
-- which should be able to fire first.
@[simp 500] theorem mem_map {f : α β} {xs : Array α} : b xs.map f a, a xs f a = b := by
@[simp 500, grind =] theorem mem_map {f : α β} {xs : Array α} :
b xs.map f a, a xs f a = b := by
simp only [mem_def, toList_map, List.mem_map]
theorem exists_of_mem_map (h : b map f l) : a, a l f a = b := mem_map.1 h

View File

@@ -1128,7 +1128,8 @@ theorem map_singleton {f : α → β} {a : α} : map f [a] = [f a] := rfl
-- We use a lower priority here as there are more specific lemmas in downstream libraries
-- which should be able to fire first.
@[simp 500] theorem mem_map {f : α β} : {l : List α}, b l.map f a, a l f a = b
@[simp 500, grind =] theorem mem_map {f : α β} :
{l : List α}, b l.map f a, a l f a = b
| [] => by simp
| _ :: l => by simp [mem_map (l := l), eq_comm (a := b)]

View File

@@ -1475,7 +1475,8 @@ theorem map_singleton {f : α → β} {a : α} : map f #v[a] = #v[f a] := by sim
-- We use a lower priority here as there are more specific lemmas in downstream libraries
-- which should be able to fire first.
@[simp 500] theorem mem_map {f : α β} {xs : Vector α n} : b xs.map f a, a xs f a = b := by
@[simp 500, grind =] theorem mem_map {f : α β} {xs : Vector α n} :
b xs.map f a, a xs f a = b := by
cases xs
simp