lean4-htt/tests/lean/run/grind_eta.lean
Leonardo de Moura 7a6bca5276
feat: basic support for eta reduction in grind (#7977)
This PR adds basic support for eta-reduction to `grind`.

---------

Co-authored-by: Kim Morrison <kim@tqft.net>
Co-authored-by: Kim Morrison <scott.morrison@gmail.com>
2025-05-15 18:34:56 +00:00

15 lines
536 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
example {l : List α} {f : β → α → β} {b : β} :
l.foldl f b = l.reverse.foldr (fun x y => f y x) b := by
grind [List.foldr_reverse]
/-
The following example doesn't work yet. `grind` doesn't have a mechanism
for inferring that `fun x y => g y x` is equal to `f` given
the equality `g = (f x y => f y x)`
-/
-- example {l : List α} {f : β → α → β} {b : β} :
-- g = (fun x y => f y x) → l.foldl f b = l.reverse.foldr g b := by
-- grind [List.foldr_reverse]