Adds support for `let_fun` to the `intro` and `intros` tactics. Also adds support to `intro` for anonymous binder names, since the default variable name for a `letFun` with an eta reduced body is anonymous.
26 lines
445 B
Text
26 lines
445 B
Text
import Lean.Elab.Tactic.Basic
|
|
import Lean.Meta.Tactic.Intro
|
|
/-!
|
|
# Testing `intro` with `letFun`
|
|
-/
|
|
|
|
/-!
|
|
Explicit `intro`.
|
|
-/
|
|
example : have x := 2; ∀ _ : Nat, x = x := by
|
|
intro x _
|
|
rfl
|
|
|
|
/-!
|
|
`intros` is aware of `letFun`.
|
|
-/
|
|
example : have x := 2; ∀ _ : Nat, x = x := by
|
|
intros
|
|
rfl
|
|
|
|
/-!
|
|
Check that it works for `letFun` with an eta reduced argument.
|
|
-/
|
|
example (p : Nat → Prop) (h : ∀ x, p x) : letFun 2 p := by
|
|
intro
|
|
apply h
|