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>
15 lines
536 B
Text
15 lines
536 B
Text
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]
|