lean4-htt/tests/lean/run/grind_list_issue.lean
Leonardo de Moura 551d6cf28b
feat: function composition normalization rules in grind (#7803)
This PR adds normalization rules for function composition to `grind`.
2025-04-03 17:00:25 +00:00

19 lines
619 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

reset_grind_attrs%
set_option grind.warning false
open List Nat
attribute [grind] List.filter_nil List.filter_cons
attribute [grind] List.any_nil List.any_cons
theorem any_filter {l : List α} {p q : α → Bool} :
(filter p l).any q = l.any fun a => p a && q a := by
induction l <;> grind
attribute [grind] List.map_nil List.map_cons
attribute [grind] List.all_nil List.all_cons
theorem any_map {l : List α} {p : β → Bool} : (l.map f).any p = l.any (p ∘ f) := by
induction l <;> grind
theorem all_map {l : List α} {p : β → Bool} : (l.map f).all p = l.all (p ∘ f) := by
induction l <;> grind