The areas / V34. The tactics of Mathlib
Mathlib.Tactic.ToFun
1 declarations. Mathlib docs ยท Source
def Mathlib.Tactic.to_fun E1 #
Lean.ParserDescr
Generate an eta-expanded version of a lemma. Adding @[to_fun] to a lemma written in "point-free"
form, e.g.
theorem Differentiable.mul (hf : Differentiable ๐ f) (hg : Differentiable ๐ g) :
Differentiable ๐ (f * g)
will generate a new lemma Differentiable.fun_mul with conclusion
Differentiable ๐ fun x => f x * g x.
You can specify the name of the new declaration manually, as in @[to_fun Differentiable.fun_mul].
If you do so, the newly generated name is namespaced to match the original declaration's name:
tagging Foo.bar with to_fun baz generates Foo.baz;
tagging Foo.Bar.baz with Bars.baz generates Foo.Bars.baz, etc.
Use the to_fun (attr := ...) (or to_fun (attr := ...) new_name) syntax
to add the same attribute to both declarations.